示例#1
0
  public static boolean isShotbowDonor(String user) throws IOException {

    Document doc =
        Jsoup.connect("https://shotbow.net/forum/search").userAgent(WebUtils.USER_AGENT).get();
    String xfToken = doc.select("input[name=_xfToken]").val();

    RequestSettings request = new RequestSettings();

    request.setGzip(false);
    request.setUrl("https://shotbow.net/forum/search/search");
    request.setHost("shotbow.net");
    request.setOrigin("https://www.shotbow.net");
    request.setReferer("https://shotbow.net/forum/portal/");

    request.addParameter("keywords", user);
    request.addParameter("users", "");
    request.addParameter("date", "");
    request.addParameter("_xfToken", xfToken);

    String response = RequestUtils.excuteSpecialPost(request);

    Document doc1 = Jsoup.parse(response);

    for (Element e : doc1.select("li.userResult")) {

      if (e.select("a.username").first().text().equalsIgnoreCase(user)) {
        return !e.select("div.userTitle").first().text().equalsIgnoreCase("Regular Member");
      }
    }

    return false;
  }
示例#2
0
  public static boolean isBukkit(String user) throws IOException {

    Document doc = Jsoup.connect("https://www.bukkit.org/").userAgent(WebUtils.USER_AGENT).get();
    String xfToken = doc.select("input[name=_xfToken]").val();

    RequestSettings request = new RequestSettings();

    request.setGzip(false);
    request.setUrl("http://bukkit.org/search/search");
    request.setHost("bukkit.org");
    request.setOrigin("http://bukkit.org");
    request.setReferer("http://bukkit.org/forums/");

    request.addParameter("keywords", user);
    request.addParameter("users", "");
    request.addParameter("date", "");
    request.addParameter("_xfToken", xfToken);

    String response = RequestUtils.excuteSpecialPost(request);

    Document doc1 = Jsoup.parse(response);

    for (Element e : doc1.select(".username")) {

      if (e.text().equalsIgnoreCase(user)) {
        return true;
      }
    }

    return false;
  }