Examples of JHTML


Examples of com.jbidwatcher.util.html.JHTML

        done = true;

        CookieJar cj = mLogin.getNecessaryCookie(false);
        String userCookie = null;
        if (cj != null) userCookie = cj.toString();
        JHTML htmlDocument = new JHTML(fullSearch, userCookie, mCleaner);
        if (htmlDocument.isLoaded()) {
          ItemResults rval = addAllItemsOnPage(htmlDocument, label, !((Searcher) searcher).shouldSkipDeleted());
          int pageResults = rval.getLast().size();
          if (pageResults != 0) {
            if (pageResults >= ITEMS_PER_PAGE) {
              skipCount += ITEMS_PER_PAGE;
View Full Code Here

Examples of com.jbidwatcher.util.html.JHTML

    if(pageURL == null) return null;

    CookieJar cj = mLogin.getNecessaryCookie(false);
    String cookies = null;
    if(cj != null) cookies = cj.toString();
    JHTML htmlDocument = new JHTML(pageURL, cookies, mCleaner);
      if(htmlDocument.isLoaded()) {
        return htmlDocument;
      } else {
        return null;
      }
  }
View Full Code Here

Examples of com.jbidwatcher.util.html.JHTML

  public void updateHighBid(String auctionId) {
    String bidHistory = Externalized.getString("ebayServer.protocol") + T.s("ebayServer.bidHost") + Externalized.getString("ebayServer.V3file") + Externalized.getString("ebayServer.viewBidsCGI") + auctionId;
    CookieJar cj = mLogin.getNecessaryCookie(false);
    String userCookie = null;
    if (cj != null) userCookie = cj.toString();
    JHTML htmlDocument = new JHTML(bidHistory, userCookie, mCleaner);

    if(htmlDocument.isLoaded()) {
      List<JHTML.Table> bidderTables = htmlDocument.extractTables();
      for (JHTML.Table t : bidderTables) {
        if (t.rowCellMatches(0, "^(Bidder|User ID).*")) {
          int bidCount = t.getRowCount() - 1; // 1 for the header

          AuctionEntry ae = (AuctionEntry) EntryCorral.getInstance().takeForWrite(auctionId);
View Full Code Here

Examples of com.jbidwatcher.util.html.JHTML

   */
  protected Date getOfficialTime() {
    UpdateBlocker.startBlocking();
    String timeRequest = Externalized.getString("ebayServer.timeURL");

    JHTML htmlDocument = new JHTML(timeRequest, null, mCleaner);
    long localDateAfterPage = System.currentTimeMillis();

    ZoneDate result = null;

    String pageStep = htmlDocument.getNextContent();
    while (result == null && pageStep != null) {
      if (pageStep.equals(T.s("ebayServer.timePrequel1")) || pageStep.equals(T.s("ebayServer.timePrequel2"))) {
        result = StringTools.figureDate(htmlDocument.getNextContent(), Externalized.getString("ebayServer.officialTimeFormat"), false, false);
      }
      pageStep = htmlDocument.getNextContent();
    }

    UpdateBlocker.endBlocking();

    //  If we couldn't get a number, clear the page request time.
View Full Code Here

Examples of com.jbidwatcher.util.html.JHTML

    StringBuffer signed_in = Http.net().receivePage(current);
    JConfig.log().dump2File("sign_in-a1.html", signed_in);

    //  Parse the redirector, and find the URL that points to the adult
    //  confirmation page.
    JHTML redirector = new JHTML(signed_in);
    if (checkSecurityConfirmation(redirector)) return null;
    return checkHTMLFollowRedirect(redirector, lookFor, cj);
  }
View Full Code Here

Examples of com.jbidwatcher.util.html.JHTML

  }

  private boolean getAdultConfirmation(URLConnection uc_signin, CookieJar cj) throws IOException {
    StringBuffer confirm = Http.net().receivePage(uc_signin);
    JConfig.log().dump2File("sign_in-a2.html", confirm);
    JHTML confirmPage = new JHTML(confirm);

    List<JHTML.Form> confirm_forms = confirmPage.getForms();
    boolean enqueued = false;
    for (JHTML.Form finalForm : confirm_forms) {
      if (finalForm.hasInput("MfcISAPICommand", "AdultSignIn")) {
        uc_signin = cj.connect(finalForm.getAction(), finalForm.getFormData(), null, true, null);
        StringBuffer confirmed = Http.net().receivePage(uc_signin);
        JConfig.log().dump2File("sign_in-a3.html", confirmed);
        JHTML htdoc = new JHTML(confirmed);
        JHTML.Form curForm = htdoc.getFormWithInput("pass");
        if (curForm != null) {
          MQFactory.getConcrete("login").enqueue("FAILED Couldn't find a password form on the sign in page.");
          return false;
        }
        enqueued = true;
        if(htdoc.grep(T.s("your.user.id.or.password.is.incorrect")) != null) {
          MQFactory.getConcrete("login").enqueue("FAILED Incorrect login information.");
        } else if(htdoc.grep(T.s("your.information.has.been.verified"))!=null) {
          MQFactory.getConcrete("login").enqueue("SUCCESSFUL");
        } else if(htdoc.grep(T.s("mature.audiences.accepted")) != null) {
          MQFactory.getConcrete("login").enqueue("SUCCESSFUL");
        } else if(htdoc.grep(T.s("mature.audiences.disallowed.outside.the.us")) != null) {
          MQFactory.getConcrete("login").enqueue("NEUTRAL Turn off 'Mature Audiences' in JBidwatcher configuration; it's not valid for non-US users.");
          JConfig.setConfiguration("ebay.mature", "false");
          JConfig.setConfiguration("ebay.international", "true");
        } else {
          JConfig.log().logFile("Neutral login result...", confirmed);
View Full Code Here

Examples of com.jbidwatcher.util.html.JHTML

      JConfig.log().logDebug(cj.dump());
    }
    try {
      StringBuffer signin = Http.net().receivePage(uc_signin);
      JConfig.log().dump2File("sign_in-1.html", signin);
      JHTML htdoc = new JHTML(signin);

      cj = signInUsingPage(startURL, username, password, isAdult, cj, htdoc);
    } catch (IOException e) {
      //  We don't know how far we might have gotten...  The cookies
      //  may be valid, even!  We can't assume it, though.
View Full Code Here

Examples of com.jbidwatcher.util.html.JHTML

          cj = retryLoginWithoutAdult(cj, username, password);
        }
      } else {
        StringBuffer confirm = Http.net().receivePage(uc_signin);
        JConfig.log().dump2File("sign_in-2.html", confirm);
        JHTML doc = new JHTML(confirm);
        if(fixYourPassword || doc.getTitle().equals("Reset your password")) {
          JConfig.log().logMessage("eBay is requesting that you change your password.");
          MQFactory.getConcrete("login").enqueue("FAILED You must change your password on eBay.");
        } else if (checkSecurityConfirmation(doc)) { //  Check for CAPTCHA and bad passwords...
          cj = null;
          MQFactory.getConcrete("login").enqueue("FAILED Sign in information is not valid.");
        } else {
          JHTML.Form redirect_form = doc.getFormWithInput("hidUrl");
          String hidUrl = null;
          if(redirect_form != null) {
            hidUrl = redirect_form.getInputValue("hidUrl");
          }
          if(hidUrl != null && (hidUrl.matches("^https?://(signin.ebay.(com|co.uk|ie))?.*my.*ebay.*(com|co.uk|ie).*ws.*eBayISAPI.dll.*My.*eBay.*$") || hidUrl.matches("^https?://www.ebay.(com|co.uk|ie).*$"))) {
View Full Code Here

Examples of com.jbidwatcher.util.html.JHTML

    //  BOY it's a small bit to test against, but Mozilla starts with <HTML>,
    //  and IE5 starts with <!DOCTYPE...  The only commonality I can trust is
    //  that they'll start with a tag, not content.  I could look for <HTML>
    //  someplace in the document...  --  mrs: 28-September-2001 03:53
    if(dropped.charAt(0) == '<') {
      JHTML tinyDocument = new JHTML(dropped);
      List<String> allItemsOnPage = tinyDocument.getAllURLsOnPage(true);

      if(allItemsOnPage == null) {
        //  This could be an image drop.
        tinyDocument.reset();
        List<String> allImagesOnPage = tinyDocument.getAllImages();
        if(allImagesOnPage.isEmpty()) {
          return;
        }

        //  Get the first image
View Full Code Here

Examples of com.jbidwatcher.util.html.JHTML

    System.out.println("URL == " + url);
  }

  private void testBidHistory(String file) {
    StringBuffer sb = new StringBuffer(StringTools.cat(file));
    JHTML hDoc = new JHTML(sb);
    List<JHTML.Table> tableList = hDoc.extractTables();

    System.err.println("There were " + tableList.size() + " tables.");

    for(JHTML.Table t : tableList) {
      if(t.rowCellMatches(0, "Bidder")) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.