Package net.sourceforge.jwbf.core.actions

Examples of net.sourceforge.jwbf.core.actions.Post


  }

    private Post getLoginMsg(final String username, final String pw,
            final String domain, final String token) {
        Post pm = new Post("/api.php?action=login&format=xml");
        pm.addParam("lgname", username);
        pm.addParam("lgpassword", pw);
        if (domain != null)
            pm.addParam("lgdomain", domain);
        if (token != null) {
            pm.addParam("lgtoken", token);
        }
        return pm;
    }
View Full Code Here


      final String domain, LoginData login) {
    super();
    this.username = username;
    this.login = login;

    Post pm = new Post(
        "/index.php?title=Special:Userlogin&action=submitlogin&type=login");
    pm.addParam("wpLoginattempt", "Log in");
    pm.addParam("wpRemember", "1");
    pm.addParam("wpName", username);
    pm.addParam("wpDomain", domain);
    pm.addParam("wpPassword", pw);


    msg = pm;

  }
View Full Code Here

    + MediaWiki.encode(title) + "&token="
    + MediaWiki.encode(token.getToken()) + "&format=xml";
    if (log.isDebugEnabled()) {
      log.debug("delete url: \"" + uS + "\"");
    }
    msg = new Post(uS);


    return msg;
  }
View Full Code Here

    // }

    try {

      LOG.info("WRITE: " + a.getTitle());
      Post post = new Post(uS);

      if (a.getText().length() == 0) {
        post.addParam("wpDestFile", a.getTitle());

        post.addParam("wpIgnoreWarning", "true");
        post.addParam("wpSourceType", "file");
        post.addParam("wpUpload", "Upload file");
        //         post.addParam("wpUploadDescription", "false");
        //         post.addParam("wpWatchthis", "false");

        post.addParam("wpUploadFile", a.getFile());
        // new FilePart( f.getName(), f)


      } else {
        post.addParam("wpDestFile", a.getTitle());

        post.addParam("wpIgnoreWarning", "true");
        post.addParam("wpSourceType", "file");
        post.addParam("wpUpload", "Upload file");
        // new StringPart("wpUploadDescription", "false"),
        // new StringPart("wpWatchthis", "false"),

        post.addParam("wpUploadFile", a.getFile());
        // new FilePart( f.getName(), f)
        post.addParam("wpUploadDescription", a.getText());


      }
      if (!a.getFile().exists()) {
        throw new FileNotFoundException();
View Full Code Here

                + "&movetalk&format=xml";

        if (log.isDebugEnabled()) {
            log.debug("move url: \"" + uS + "\"");
        }
        msg = new Post(uS);


        return msg;
    }
View Full Code Here

        e.printStackTrace();
      }
    }
    if (apiEdit) {
      String uS = "/api.php?action=edit&title=" + MediaWiki.encode(a.getTitle());
      postModify = new Post(uS);
      postModify.addParam("summary", a.getEditSummary());
      postModify.addParam("text", a.getText());
      try {
        Set<String> groups = bot.getUserinfo().getGroups();
        if (!Misc.isIntersectionEmpty(groups, MediaWiki.BOT_GROUPS)) {
          postModify.addParam("bot", "");
        }
      } catch (JwbfException e) {
        log.warn("{}", e);
      }

      //      postModify.addParam("watch", "unknown")
      if (a.isMinorEdit())
        postModify.addParam("minor", "");
      else
        postModify.addParam("notminor", "");
      postModify.addParam("token", apiReq.getToken());

    } else {
      String uS = "/index.php?title=" + MediaWiki.encode(a.getTitle())
      + "&action=submit";

      postModify = new Post(uS);
      postModify.addParam("wpSave", "Save");

      postModify.addParam("wpStarttime", tab.get("wpStarttime"));

      postModify.addParam("wpEditToken", tab.get("wpEditToken"));
View Full Code Here

TOP

Related Classes of net.sourceforge.jwbf.core.actions.Post

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.