From: <kev...@us...> - 2003-07-10 03:56:22
|
Update of /cvsroot/bidwatcher/bidwatcher In directory sc8-pr-cvs1:/tmp/cvs-serv5203 Modified Files: bidwatcher.cpp bidwatcher.spec configure.in helpers.cpp Log Message: Some more updates thanks to Klaus Singvogel. Also bumped version. Index: bidwatcher.cpp =================================================================== RCS file: /cvsroot/bidwatcher/bidwatcher/bidwatcher.cpp,v retrieving revision 1.166 retrieving revision 1.167 diff -u -d -r1.166 -r1.167 --- bidwatcher.cpp 9 Jul 2003 03:24:52 -0000 1.166 +++ bidwatcher.cpp 10 Jul 2003 03:56:19 -0000 1.167 @@ -3339,7 +3339,7 @@ if (timeToNextEnd() < 5*60) return TRUE; - if (Update(-1, FALSE)) + if (Update(-1, FALSE) == FALSE) return TRUE; } updateInProgress=FALSE; @@ -3355,8 +3355,11 @@ if (bigUpdate()) { // Try again later. gtk_timeout_add(2*60*1000, bigdelay_callback, NULL); + DPRINTF(DHIGH, "Next bigUpdate() in 2 minutes.\n"); } else { gtk_timeout_add(BIGDELAY, bigdelay_callback, NULL); + DPRINTF(DHIGH, "Next bigUpdate() in %i minutes.\n", + BIGDELAY/60/1000); } return FALSE; @@ -3666,7 +3669,8 @@ strcpy(price," -"); break; case 2: - sprintf(price,"%.2f",auction[i]->CurrentBid); + sprintf(price,"%s%.2f(%d)", auction[i]->currency, + auction[i]->CurrentBid,auction[i]->BidCount); break; default: char flags[3]; flags[0]=0; @@ -4002,8 +4006,10 @@ strcpy(price, " -"); break; case 2: - sprintf(price, "%.2f", auction[i]->CurrentBid); - break; + sprintf(price, "%s%.2f(%d)", auction[i]->currency, + auction[i]->CurrentBid,auction[i]->BidCount); + + break; default: char flags[3]; flags[0]=0; if (auction[i]->reserveMet == 'n') strcat(flags, "R"); @@ -4149,6 +4155,19 @@ Buff = StripHtmlTags(HtmlBuff); free(HtmlBuff); +#if defined(DEBUGGING) && DEBUGGING>DMED + { + FILE *fd; + if ((fd = fopen("/tmp/bidwatcher-buf.txt", "a+")) != NULL) + { + fprintf(fd, "%s\n", Buff); + fprintf(fd, "-- ---------------------- -- ---------------------- -- " + "---------------------- \n"); + fclose(fd); + } + } +#endif + // Check to see if this isn't really auction data. if (stristr(Buff, "Regularly Scheduled Maintenance")) { free(Buff); @@ -4390,9 +4409,10 @@ MakeFileName(fnstring, fileName, TRUE); reportOut.open(fileName, ios::app); char truncDesc[300]; - sprintf(truncDesc,"%lu - %s\nHigh Bidder: %s\n High Bid: %.2f", + sprintf(truncDesc,"%lu - %s\nHigh Bidder: %s%s\n High Bid: %s %.2f", auction[index]->ItemNumber,auction[index]->Description, - auction[index]->HighBidder,auction[index]->CurrentBid); + auction[index]->HighBidder,auction[index]->BidderRate, + auction[index]->currency,auction[index]->CurrentBid); strcat(truncDesc, "\n-----------------------------------------------------\n"); reportOut << truncDesc; reportOut.close(); Index: bidwatcher.spec =================================================================== RCS file: /cvsroot/bidwatcher/bidwatcher/bidwatcher.spec,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- bidwatcher.spec 18 Jan 2003 05:41:11 -0000 1.12 +++ bidwatcher.spec 10 Jul 2003 03:56:19 -0000 1.13 @@ -1,6 +1,6 @@ Summary: Bidwatcher tracks and snipes eBay auctions Name: bidwatcher -%define version 1.3.8 +%define version 1.3.9 Version: %{version} Release: 1 Source: http://prdownloads.sourceforge.net/bidwatcher/bidwatcher-%{version}.tar.gz Index: configure.in =================================================================== RCS file: /cvsroot/bidwatcher/bidwatcher/configure.in,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- configure.in 18 Jan 2003 05:30:33 -0000 1.20 +++ configure.in 10 Jul 2003 03:56:19 -0000 1.21 @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(bidwatcher.h) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(bidwatcher,1.3.8) +AM_INIT_AUTOMAKE(bidwatcher,1.3.9) dnl Checks for programs. AC_PROG_CC Index: helpers.cpp =================================================================== RCS file: /cvsroot/bidwatcher/bidwatcher/helpers.cpp,v retrieving revision 1.86 retrieving revision 1.87 diff -u -d -r1.86 -r1.87 --- helpers.cpp 9 Jul 2003 03:24:53 -0000 1.86 +++ helpers.cpp 10 Jul 2003 03:56:19 -0000 1.87 @@ -68,7 +68,7 @@ "Starting bid", // 17 "Seller (rating)", // 18 "High bidder", // 19 - "Price", // 20 + " Price", // 20 "Seller information", // 21 "History", // 22 "Winning bid:", // 23 @@ -983,7 +983,7 @@ case 16: case 20: // "Price" -BuyItNow Only. case 23: - if (CurrentBid==0) { + if (!CurrentBid) { streamBuff.getline(LineData, 1024, '\n'); if (strstr(LineData, "Buy It Now")) { @@ -1009,7 +1009,7 @@ break; case 3: // first bid case 17: - if (!FirstBid) { + if (!FirstBid && !CurrentBid) { streamBuff.getline(LineData, 1024, '\n'); DPRINTF(DLOW, "LDFB: %s\n", LineData); parseprice(LineData, this, TRUE); @@ -1076,9 +1076,12 @@ case 18: case 21: if (!Seller[0]) { + unsigned int count; + streamBuff.getline(LineData, 1024, '\n'); strncpy(Seller, LineData, 75); - for (unsigned int count=0; count < sizeof(Seller); count++) + + for (count=0; count < sizeof(Seller); count++) { if (Seller[count] == '(') { @@ -1086,6 +1089,21 @@ break; // ignore the rest } } + + // Seller Rate is typicaly in next line, but without leading '(' + streamBuff.getline(LineData, 1024, '\n'); + if (!strchr(LineData, ')')) + break; // validity check + SellerRate[0] = '('; + for (count=1; count < sizeof(SellerRate)-1; count++) + { + if (LineData[count-1] == '\0' || LineData[count-1] == ')' + || LineData[count-1] == ' ') + break; + SellerRate[count] = LineData[count-1]; + } + SellerRate[count] = ')'; + SellerRate[count+1] = '\0'; } break; case 11: // high bidder id @@ -1230,18 +1248,20 @@ // and assign them to .SellerRate and .BidderRate strcpy(newName, Seller); - DPRINTF(DLOW, "Seller: %s\n", Seller); + DPRINTF(DLOW, "Seller: %s %s\n", Seller, SellerRate); scratch = strtok(newName, " "); - if (!scratch) return FALSE; - - strcpy(Seller, scratch); - scratch = strtok(0, ")"); + //if (!scratch) return FALSE; if (scratch) { - strcpy(SellerRate, scratch); - strcat(SellerRate, ")"); + strcpy(Seller, scratch); + scratch = strtok(0, ")"); + + if (scratch) { + strcpy(SellerRate, scratch); + strcat(SellerRate, ")"); + } } if (isBuyItNow || @@ -1249,6 +1269,9 @@ (!strcmp(HighBidder, "see Dutch high bidders")) || (!strcmp(HighBidder, "--"))) { return TRUE; + } else if (!strcmp(HighBidder, "User ID kept private")) { + strcpy(HighBidder, "privat"); // it's nicer to have this text in log + return TRUE; } else { strcpy(newName, HighBidder); scratch = strtok(newName, " "); @@ -1261,7 +1284,7 @@ strcat(BidderRate, ")"); } } else { - strcpy(HighBidder, "No bids"); + strcpy(HighBidder, "--"); strcpy(BidderRate, "(0)"); } |