Package com.jbidwatcher.util.http

Examples of com.jbidwatcher.util.http.CookieJar


  public StringBuffer getAuction(URL auctionURL) throws FileNotFoundException {
    if(auctionURL == null) return null;
    StringBuffer loadedPage;

    try {
      CookieJar curCook = getNecessaryCookie(false);
      URLConnection uc;
      if(curCook != null) {
        uc = curCook.connect(auctionURL.toString());
      } else {
        uc = Http.net().makeRequest(auctionURL, null);
      }
      loadedPage = Http.net().receivePage(uc);
      if(loadedPage != null && loadedPage.length() == 0) {
View Full Code Here


      JConfig.log().logDebug("Checking sign in as bid key load failed!");
      if (StringTools.startsWithIgnoreCase(signOn, "sign in")) {
        //  This means we somehow failed to keep the login in place.  Bad news, in the middle of a snipe.
        JConfig.log().logDebug("Being prompted again for sign in, retrying.");
        if(JConfig.debugging) inEntry.setLastStatus("Not done loading bid request, got re-login request...");
        CookieJar cj = mLogin.getSignInCookie(null);
        if(JConfig.debugging) inEntry.setLastStatus("Done re-logging in, retrying load bid request.");
        return cj;
      }
    }
    return null;
View Full Code Here

    buyRequest += "&item=" + ae.getIdentifier() + "&quantity=" + quantity;

    StringBuffer sb;

    try {
      CookieJar cj = mLogin.getNecessaryCookie(false);
      sb = cj.getPage(buyRequest, null, null);
      JHTML doBuy = new JHTML(sb);
      JHTML.Form buyForm = doBuy.getFormWithInput("uiid");

      if (buyForm != null) {
        buyForm.delInput("BIN_button");
        StringBuffer loadedPage = cj.getPage(buyForm.getAction(), buyForm.getFormData(), buyRequest);
        if (loadedPage == null) return AuctionServerInterface.BID_ERROR_CONNECTION;
        return handlePostBidBuyPage(cj, loadedPage, buyForm, ae);
      }
    } catch (CookieJar.CookieException ignored) {
      return AuctionServerInterface.BID_ERROR_CONNECTION;
View Full Code Here

  public int bid(AuctionEntry inEntry, Currency inBid, int inQuantity) {
    UpdateBlocker.startBlocking();
    if(JConfig.queryConfiguration("sound.enable", "false").equals("true")) MQFactory.getConcrete("sfx").enqueue("/audio/bid.mp3");

    CookieJar cj = mLogin.getNecessaryCookie(false);
    JHTML.Form bidForm;

    try {
      bidForm = getBidForm(cj, inEntry, inBid);
    } catch(BadBidException bbe) {
View Full Code Here

   * <p/>
   * This obsoletes our previous use of 'My eBay' to get the selling
   * information.
   */
  void getSellingItems(String userId, String curUser, String label) {
    CookieJar cj = mLogin.getNecessaryCookie(false);
    String userCookie = null;
    if (cj != null) userCookie = cj.toString();

    if (userId == null || userId.equals("default")) {
      JConfig.log().logMessage("Cannot load selling pages without at least a userid.");
      return;
    }
View Full Code Here

   *
   * @param curUser - The current user that we are loading My eBay for.
   * @param label - What 'group' to label items retrieved this way as.
   */
  void getMyEbayItems(String curUser, String label) {
    CookieJar cj = mLogin.getNecessaryCookie(false);
    String userCookie = null;
    ItemResults rval;
    if (cj != null) userCookie = cj.toString();

    if (curUser == null || curUser.equals("default")) {
      JConfig.log().logMessage("Cannot load My eBay pages without a userid and password.");
      return;
    }
View Full Code Here

      boolean done;

      do {
        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) {
View Full Code Here

  }

  protected JHTML getPage(String pageURL) {
    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

    return esm;
  }

  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) {
View Full Code Here

    String msg = "Getting the sign in cookie for " + T.getCountrySiteName();

    JConfig.log().logDebug(msg);
    MQFactory.getConcrete("Swing").enqueue(msg);

    CookieJar cj = getSignInCookie(getUserId(), getPassword());

    String done_msg = (cj!=null)?"Done getting the sign in cookie for ":"Did not successfully retrieve the sign in cookie for ";
    done_msg += T.getCountrySiteName();
    MQFactory.getConcrete("Swing").enqueue(done_msg);
    JConfig.log().logDebug(done_msg);
View Full Code Here

TOP

Related Classes of com.jbidwatcher.util.http.CookieJar

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.