Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:kssingvo
bidwatcher
bidwatcher-1.3.17-changes_20061123a.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bidwatcher-1.3.17-changes_20061123a.patch of Package bidwatcher
--- bidwatcher-1.3.17/helpers.cpp.orig 2006-11-23 15:51:38.000000000 +0100 +++ bidwatcher-1.3.17/helpers.cpp 2006-11-23 15:50:26.000000000 +0100 @@ -55,49 +55,27 @@ const char * const CheckPrice="0123456789.$,"; // Characters allowed in a price -const char * const SearchOps[2][42]={{ "Starts at", // 1 - "Currently", // 2 - "Starting bid", // 3 - "Quantity", // 4 - "# of bids", // 5 - "Time left", // 6 - "Item location", // 7 - "Started", // 8 - "Ends", // 9 - "Seller (Rating)", // 10 - "High bid", // 11 - "Bid increment", // 12 - "This is a ", // 13 - "Lowest", // 14 - "(Reserve ", // 15 - "Current bid", // 16 - "Starting bid", // 17 - "Seller (rating)", // 18 - "High bidder", // 19 - "Price:", // 20 - "Seller information", // 21 - "History", // 22 - "Winning bid:", // 23 - "Winning bidder:", // 24 - "Sold for", // 25 - "Buyer:", // 26 - "Bidding has ended", // 27 - // for some reason theBuyItNow/Purchase only - // auction have a space in front of "Price". - " Price", // 28 - "Feedback Score:", // 29 - "(Approximately", // 30 - "Ended:", // 31 - "Shipping, payment details and return policy", // 32 - "Shipping Cost Services Available", // 33, newer version of above - " price:", // 34 - "price:", // 35 - "Seller information", // 36 - "Score:", // 37 - "Seller:", // 38 - "End time:", // 39 - "RefreshStarting bid", // 40 - "RefreshCurrent bid", // 41 +const char * const SearchOps[2][21]={{ // new <- old + "Starting bid", // 1 <- 3 + "Quantity", // 2 <- 4 + "Item location", // 3 <- 7 + "High bid", // 4 <- 11 + "This is a ", // 5 <- 13 + "Current bid", // 6 <- 16 + "Starting bid", // 7 <- 17 + "History", // 8 <- 22 + "Winning bid:", // 9 <- 23 + "Winning bidder:", // 10 <- 24 + "Sold for", // 11 <- 25 + "Buyer:", // 13 <- 26 + "Bidding has ended", // 13 <- 27 + "(Approximately", // 14 <- 30 + "Ended:", // 15 <- 31 + "Shipping, payment details and return policy", // 16 <- 32 + "price:", // 17 <- 35 + "Score:", // 18 <- 37 + "Seller:", // 19 <- 38 + "End time:", // 20 <- 39 "*"}, /* eBay Motors */ { "Currently", // 1 @@ -1033,18 +1011,6 @@ return parseprice(auc->currency, auc->BuyitNowPrice, buf); } -static void getShipHandling33(StringBuffer &streamBuff, char *LineData, const int LineDataSize, float ship[], char currency[][10], int num_ship) -{ - for(int i = 0; i < num_ship; i++) { - streamBuff.getline(LineData, LineDataSize, '\n'); - if(strnzcmp(LineData, "Will ship") == 0) break; - if(!parseprice(currency[i], ship[i], LineData)) { - ship[i] = 0; - break; - } - } -} - /* a "Shipping and Handling" line looks currently like this: * Ships to * @@ -1339,23 +1305,14 @@ } case TYPE_EBAYMOTORS: //non-car auctions are the same switch (matchedPhrase) { - case 33: // shipping + handling - getShipHandling33(streamBuff, LineBuffer.buf(), LineBuffer.size(), Shipping, ShippingCur, sizeof(Shipping) / sizeof(Shipping[0])); - break; - - case 32: // shipping + handling + case 16: // shipping + handling getShipHandling32(streamBuff, LineBuffer.buf(), LineBuffer.size(), Shipping, ShippingCur, sizeof(Shipping) / sizeof(Shipping[0])); break; - case 1: - case 2: // current price - case 14: // "Lowest" -shows up on motorsnotcars - case 16: - case 17: - case 23: - case 25: // "Sold for" - case 40: // "RefreshStarting bid" - case 41: // "RefreshCurrent bid" + case 6: + case 7: + case 9: + case 11: // "Sold for" if (!bid_flag) { DPRINTF(DLOW, ("LDCB: %s\n", LineBuffer.buf())); if (!parseprice(LineBuffer.buf(), this, FALSE)) @@ -1379,14 +1336,14 @@ } break; - case 3: // Starting bid: EUR 1.99 + case 1: // Starting bid: EUR 1.99 if (!FirstBid && !first_flag) { parseprice(LineBuffer.buf(), this, TRUE); if (!CurrentBid) CurrentBid = FirstBid; } break; - case 30: + case 14: if (!strstr(LineBuffer.buf(), "(Approximately")) break; if (!FirstBid && !first_flag && strnzcmp(LineBuffer.buf(), "(Approximately")) { @@ -1403,10 +1360,7 @@ } break; - case 20: // "Price:" - BuyItNow Only. - case 28: // " Price" - case 34: // " price:" - case 35: // "price:" + case 17: // "price:" DPRINTF(DLOW, ("This is a BuyItNow\n")); if (!buynow_flag) { buynow_flag = 1; @@ -1439,7 +1393,7 @@ } break; - case 4: // quantity + case 2: // quantity if (!Quantity && !quant_flag) { quant_flag=1; if (strchr(LineBuffer.buf(), ':')) @@ -1449,8 +1403,7 @@ DPRINTF(DLOW, ("LDBC: %s\n", LineBuffer.buf())); } break; - case 5: // bid count - case 22: + case 8: if (!BidCount) { DPRINTF(DLOW, ("LDBC: %s\n", LineBuffer.buf())); // if instead of the number of bids an item has "Purchases" and @@ -1483,21 +1436,11 @@ DPRINTF(DLOW, ("BidCount: %i\n", BidCount)); } break; - case 6: // time left - if (!TimeLeft[0]) { - streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); - STRNZCPY(TimeLeft, LineBuffer.buf()); - if (strstr(LineBuffer.buf(), "Auction has ended")) { //DBS - ended_early = 1; //DBS - } - // since there is time left the auction cannot be endless. - } - break; - case 27: // Item has ended + case 13: // Item has ended ended_early =1; // if the item has ended it is obviously not endless. break; - case 7: // location + case 3: // location if (!Location[0]) { char *p; if (!strchr(LineBuffer.buf(), ',')) { @@ -1515,22 +1458,7 @@ } } break; - case 8: // time started - if (!Started[0]) { - streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); - STRNZCPY(Started, LineBuffer.buf()); - translate_date(Started); - } - break; - case 9: // time ending - if (!Ends[0]) { - //streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); - //DPRINTF(DLOW, ("LDE: %s\n", LineBuffer.buf())); - STRNZCPY(Ends, LineBuffer.buf() + strlen("Ends ")); - translate_date(Ends); - EndsValue = CalcEndsValue(Ends); - } - case 39: // "End time:" + case 20: // "End time:" // has 3 possibilities of string: // 1. "End time:10 hours 7 mins" // " (Mar-08-06 12:52:47 PST)" @@ -1549,7 +1477,7 @@ EndsValue = CalcEndsValue(Ends); } break; - case 31: // "Ended:" looks like this: + case 15: // "Ended:" looks like this: // Ended: Nov-16-06 13:43:36 PST if (!Ends[0]) { char *p; @@ -1563,40 +1491,7 @@ isEndless = 0; } break; - case 10: // seller id - case 18: - case 21: - case 36: - if (!Seller[0]) { - unsigned int count; - char *p; - - streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); - if (*LineBuffer.buf() == '\0') streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); - STRNZCPY(Seller, LineBuffer.buf()); - - /* Don't cut on '('! "(www.grahamcrackers.com)" is a valid ebay account */ - /* strip only "(private)" away */ - p = strstr(Seller, "(private)"); - if (p) *p='\0'; - - // Seller Rate is typicaly in next line, but without leading '(' - streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); - if (!strchr(LineBuffer.buf(), ')')) streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); - if (!strchr(LineBuffer.buf(), ')')) - break; // validity check - SellerRate[0] = '('; - for (count=1; count < sizeof(SellerRate)-1; count++) { - if (LineBuffer.buf()[count-1] == '\0' || LineBuffer.buf()[count-1] == ')' - || LineBuffer.buf()[count-1] == ' ') - break; - SellerRate[count] = LineBuffer.buf()[count-1]; - } - SellerRate[count] = ')'; - SellerRate[count+1] = '\0'; - } - break; - case 38: // Seller: + case 19: // Seller: //Line looks currently like this 2006-09-21: "Seller: somename( 55) " if (!Seller[0]) { char *p; @@ -1656,7 +1551,7 @@ STRNZCPY(Feedbackn,"NONE"); } break; - case 37: // Score: + case 18: // Score: // Example: Score: 1762 | 99.9% Positive // Example: Score: Private | 97.0% Positive if (!Feedbackn[0]) { @@ -1713,10 +1608,9 @@ DPRINTF(DLOW, ("Score: Feedbackn= >%s<\n", Feedbackn)); } break; - case 11: // high bidder id - case 19: - case 24: - case 26: // "Buyer:" + case 4: // high bidder id + case 10: + case 12: // "Buyer:" if (!HighBidder[0]) { char *p; p = strchr(LineBuffer.buf(), ':'); @@ -1767,7 +1661,7 @@ // STRNZCPY(BidInc, LineBuffer.buf()); // break; - case 13: // dutch auction + case 5: // dutch auction if (strncmp(LineBuffer.buf(), "This is a private listing.", 26) == 0) break; streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); @@ -1775,59 +1669,13 @@ strcpy(HighBidder, "Dutch Auction"); break; - case 29: // Feedback Score: - if (!Feedbackn[0]) { - char TmpLine[6]; - unsigned int count; - int limit = 0; - int iiii=0; - char *p; - - p = LineBuffer.buf(); - while(!isdigit(*p) && *p) - p++; - if (*p == '\0') { - streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); - STRNZCPY(Feedbackn, LineBuffer.buf()); - } else { - STRNZCPY(Feedbackn, p); - } - streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); - - limit = strlen(LineBuffer.buf()); - - for (count=0; count < limit; count++) - { - if (LineBuffer.buf()[count] == ':') { - LineBuffer.buf()[count] = count; // truncate string at first ':' - for (int fb=count+1; fb < limit; fb++) - { - TmpLine[iiii] = LineBuffer.buf()[fb + 1]; - iiii++; - } - } - } - CheckBadChars(Feedbackn,"0123456789"); - if ( strstr(LineBuffer.buf(),"Feedback") != NULL) { - int a1=6, c1=strlen(Feedbackn); - while (c1 < a1) { /* adds spaces */ - strcat(Feedbackn, " "); - c1++; - } - strcat(Feedbackn,TmpLine); - } else { - CheckBadChars(Feedbackn,"123456789"); - STRNZCPY(Feedbackn,"NONE"); - } - } - break; - - - case 15: // reserve auctions +#if 0 + case ??: // reserve auctions if (strstr(LineBuffer.buf(),"Reserve not")) reserveMet = 'n'; else if (strstr(LineBuffer.buf(),"Reserve met")) reserveMet = 'y'; +#endif default:; } @@ -1868,7 +1716,6 @@ STRNZCPY(Seller, LineBuffer.buf()); } break; - case 14: case 4: //High bid if (!HighBidder[0]) { streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); @@ -1899,7 +1746,6 @@ translate_date(Started); } break; - case 12: case 8: //Ends if (!Ends[0]) { streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n');
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor