Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:kssingvo
bidwatcher
bidwatcher-1.3.17-changes_20070719.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bidwatcher-1.3.17-changes_20070719.patch of Package bidwatcher
--- bidwatcher-1.3.17/bidwatcher.h.orig 2007-07-19 22:52:10.000000000 +0200 +++ bidwatcher-1.3.17/bidwatcher.h 2007-07-19 22:52:41.000000000 +0200 @@ -191,7 +191,7 @@ ~auctioninfo(); int getinfo(); bool parseaucinfo(const char *); - char *parseDescription(char *, bool); + char *parseDescription(const char *from, char *to); void getkey(float bid, int quantity); int bid(bool); --- bidwatcher-1.3.17/helpers.cpp.orig 2007-07-19 22:52:10.000000000 +0200 +++ bidwatcher-1.3.17/helpers.cpp 2007-07-19 22:55:23.000000000 +0200 @@ -1138,46 +1138,23 @@ * but that's not what I'm going to do right now. * Thanks to Bob Beaty! */ - scratch = strstr(Buff, "eBay: "); + /* the first line changed. There is no more difference between eBay + * and eBay Motors anymore. Both are equal, and the syntax has changed + * too (2007-07-19, Klaus Singvogel) + */ + scratch = strstr(Buff, " on eBay "); if (scratch != NULL) { - DPRINTF(DLOW, ("found 'eBay:' in auction, new type, scanning...\n")); + DPRINTF(DLOW, ("found ' on eBay ' in auction, new type, scanning...\n")); - scratch = parseDescription(scratch, false); + scratch = parseDescription(Buff, scratch); DPRINTF(DLOW, ("Auction name = '%s'\n", Description)); } else { - scratch = strstr(Buff, "eBay Motors: "); - if (scratch != NULL) { - DPRINTF(DLOW, ("found 'eBay Motors:' in auction. New type. Scanning...\n")); - scratch = parseDescription(scratch, true); - DPRINTF(DLOW, ("Auction name = '%s'\n", Description)); - } else { - DPRINTF(DLOW, ("no mandatory matching 'eBay:' nor 'eBay Motors:' in buffer\n")); - return FALSE; - } - + DPRINTF(DLOW, ("no mandatory matching ' on eBay ' in buffer\n")); + return FALSE; } - StringBuffer streamBuff(Buff); - /* Skip everything before the start of auction data */ - - memset(LineBuffer.buf(), 0, LineBuffer.size()); - - while(strstr(LineBuffer.buf(),"eBay")==NULL && streamBuff) - streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); - - if (strstr(LineBuffer.buf(),"eBay: ") == NULL) - if (strstr(LineBuffer.buf(),"eBay Motors: ") == NULL) { - DPRINTF(DLOW, ("no matching 'eBay:' nor 'eBay Motors:' in buffer. Failed.\n")); - return FALSE; - } - - if (strstr(LineBuffer.buf(),"eBay Motors:") != NULL) - auc_type = TYPE_EBAYMOTORSCAR; - - while(strstr(LineBuffer.buf()," (item")==NULL && streamBuff) - streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); if ( strstr(LineBuffer.buf(),"Another buyer used Buy It Now to purchase the item immediately") == NULL ){ scratch = strstr(Buff, "Another buyer used Buy It Now to purchase the item immediately"); @@ -1507,6 +1479,7 @@ *p = '\0'; } } + DPRINTF(DLOW, ("Seller: %s\n", Seller)); if (!SellerRate[0]) { char *p; @@ -1540,6 +1513,7 @@ if (!strncmp(SellerRate, "(0)", 4)) STRNZCPY(Feedbackn,"NONE"); } + DPRINTF(DLOW, ("SellerRate: %s\n", SellerRate)); break; case 7: // Score: // Example: Score: 1762 | 99.9% Positive @@ -1839,31 +1813,26 @@ return TRUE; } // end GetAucInfo() -char *auctioninfo::parseDescription(char *scratch, bool motors) { +char *auctioninfo::parseDescription(const char *from, char *till) { unsigned int idx, len; - char *end; - // move past the title - scratch += strlen(motors ? "eBay Motors: " : "eBay: "); + while (isspace(*till)) + till--; - // move past any whitespace - while (isspace(*scratch)) scratch++; // copy over the description to a newline idx = 0; - if ((end = strstr(scratch, "(item")) != NULL) { - len = end - scratch; - len = (len < sizeof(Description)-1) ? len : sizeof(Description-1); - } else { - len = sizeof(Description) - 1; - } + len = sizeof(Description) - 1; - while (*scratch != '\n' && idx < len) { - Description[idx++] = *scratch++; + while (&from[idx] <= till && idx < len) { + Description[idx] = from[idx]; + idx++; } // NULL terminate the description I just parsed off - Description[idx-1] = '\0'; + Description[idx] = '\0'; + + DPRINTF(DLOW, ("Description: %s\n", Description)); - return scratch; + return till+sizeof(" on eBay "); } void MakeFileName(char * prefix2, char * fileName, bool thisMonth)
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