♥auctionblox Posted October 20, 2003 Share Posted October 20, 2003 One of the great thing about community is the ideas that are generated collectively. Regarding email parsing from eBay: Pros: 1. Easily do-able 2. It's a great "trigger" mechanism Cons: 1. Email is un-reliable 2. You can only do this if you can intercept the email on the server Most ISP/home configurations are not set up this way :-( Regarding parsing eBay pages: Pros: 1. Data is guaranteed to be correct Cons: 1. It is extremely difficult to "scrape" anything from eBay that requires a login to eBay. Email address requires login. 2. Scraping is inherently un-reliable 3. There is no trigger. You simply have to poll My Ebay to get the information. Yes, you can "schedule" the polling based on auction end time, but it does not work for Buy It Now auctions. Quote Link to comment Share on other sites More sharing options...
Guest Posted October 21, 2003 Share Posted October 21, 2003 Ok I am really stumped...I got it to update ok, and it enters the auction the first time alright, but if you run it a second item I get this error. 1062 - Duplicate entry '3048756776' for key 2 INSERT INTO auction_basket ( `auction_basket_id` , `auction_house_id` , `auction_item_id` , `ext_id` , `auction_winner_id` , `listing_status` , `time_start` , `time_end` , `orders_id` , `ext_title` , `ext_desc` , `quantity` , `price_start` , `price_end` , `insurance` , `shipping` , `sales_tax` , `products_id` ) VALUES ('', '1', '0', '3048756776', '1', '2', '2003/9/22 3::', '2003/9/29 11:51:32', NULL , 'DEC DIGITAL ALPHA ALPHASERVER 4000 ***LOOK***', NULL , '1', '0.0000', '152.50', '0.0000', '0.0000', '0.0000', '1') [TEP STOP] Here is the code: $query_result_handle = tep_db_query ("select ext_id from " . TABLE_AUCTION_BASKET) or die ('The query failed!'); // use mysql_fetch_row to retrieve the results while ($row = mysql_fetch_row ($query_result_handle)) { if ($row[0] == $itemnum) { tep_db_query ("UPDATE " . TABLE_AUCTION_BASKET . " SET time_end = '$time_end' WHERE ext_id = '$itemnum'"); tep_db_query ("UPDATE " . TABLE_AUCTION_BASKET . " SET price_end = '$Price' WHERE ext_id = '$itemnum'"); echo mysql_errno() . ": " . mysql_error(). " update\n"; } if ($row[0] != $itemnum) { tep_db_query ("INSERT INTO " . TABLE_AUCTION_BASKET . " ( `auction_basket_id` , `auction_house_id` , `auction_item_id` , `ext_id` , `auction_winner_id` , `listing_status` , `time_start` , `time_end` , `orders_id` , `ext_title` , `ext_desc` , `quantity` , `price_start` , `price_end` , `insurance` , `shipping` , `sales_tax` , `products_id` ) VALUES ('', '1', '0', '$itemnum', '1', '2', '$time_start', '$time_end', NULL , '$Title', NULL , '1', '0.0000', '$Price', '0.0000', '0.0000', '0.0000', '1')"); echo mysql_errno() . ": " . mysql_error(). "added\n"; } } I think it has to do with the "while" loop. It compairs the itemnum to each entry. There has got to be a better way to compair $itemnum (which is the item number from ebay) with the ext_id feild in the auction_basket table. :o PLEASE HELP :o Mysql is my weak point, and I am so close I can taste it. Quote Link to comment Share on other sites More sharing options...
♥auctionblox Posted October 21, 2003 Share Posted October 21, 2003 Smitty, you do not need the internal while loop. for each $itemnum that you retrieve: $query = tep_db_query("select ext_id from " . TABLE_AUCTION_BASKET . "where ext_id = '" . $itemnum . "'"); if (tep_db_num_rows($query) > 0) { // do update } else { // do insert } Quote Link to comment Share on other sites More sharing options...
defender39 Posted October 21, 2003 Share Posted October 21, 2003 nice code...so where does it go? Quote Link to comment Share on other sites More sharing options...
Guest Posted October 21, 2003 Share Posted October 21, 2003 (edited) auctionblox you ROCK! I knew I was just making things more complicated than they needed to be. Ok the script works, now I just need to build an admin page for the setings and it will be done. I will keep plugging away. Edited October 21, 2003 by smitty1 Quote Link to comment Share on other sites More sharing options...
Guest Posted October 21, 2003 Share Posted October 21, 2003 Oh.. :) Nice job. Waiting for the code now. But we still has the SSL problem. I am weak at PHP, so sorry about doing nothging. The SSL is important because when the customer check out especially you want accept CC directly. Quote Link to comment Share on other sites More sharing options...
Guest Posted October 21, 2003 Share Posted October 21, 2003 Every now and then I get the following error: Fatal error: Cannot instantiate non-existent class: auctioncart in /var/www/html/osc/catalog/includes/application_top.php on line 273 //+++AUCTIONBLOX.COM if (tep_session_is_registered('auctionCart') && is_object($auctionCart)) { if (PHP_VERSION < 4) { $broken_cart = $cart; $auctionCart = new auctionCart; $auctionCart->unserialize($broken_cart); } } else { tep_session_register('auctionCart'); <-- 273 $auctionCart = new auctionCart; }//+++AUCTIONBLOX.COM Looks like it has problems with getting a new session. Ideas? Quote Link to comment Share on other sites More sharing options...
Guest Posted October 22, 2003 Share Posted October 22, 2003 Almost done. I was thinking of adding one more thing. I am not sure if it would work so I would like to get some opinions. I have made a update auction listing button, but this is too much of a manual process for me. It would be nice if this could happed automatically about every 12 hours or so. So, in researching I came across this cool little php command called "sleep". Could "sleep" be used in a while loop and ran indefinitely? Or would this consume to much memory and result in a disaster. Should I look for a java countdown timer to run in the background? Even if I went with option number two I still would need a while loop to restart it every 12 hours or whatever. I am thinking of adding something like this: while ( 1 > 0) { require_once("get_auction_info.php"); // sleep works in minutes ex. 720 minutes in 12 hours sleep(720); require_once("get_auction_info.php"); // sleep works in minutes ex. 720 minutes in 12 hours sleep(720); } What do you think? Any feedback? Quote Link to comment Share on other sites More sharing options...
Guest Posted October 22, 2003 Share Posted October 22, 2003 (edited) Oh, I almost forgot. Auctionblox Do you think there is a way when the winning bidder comes to auction_finder.php to have them login with their ebay username instead of email? I am able to parse the ebay username. I use paypal to send out the email after the auction has ended and the winner could come to auction_finder.php put in their username and when they check out it could populate the email feild in auction_basket? This may be an alternative to the email problem. :unsure: Edited October 22, 2003 by smitty1 Quote Link to comment Share on other sites More sharing options...
Guest Posted October 22, 2003 Share Posted October 22, 2003 Smitty1 (Joe) what about using cron to run the php file to do the updates? i currently use this for a feedback mod which checks for new accounts w carts abandoned and sends a feedback request,, it can be set for any time frame i want. just a thought Regards Tom Quote Link to comment Share on other sites More sharing options...
Guest Posted October 22, 2003 Share Posted October 22, 2003 That's a great idea. But, I would like to design this to run independantly. I would like this to run on webservers or webspace (for those without a webserver). :) Quote Link to comment Share on other sites More sharing options...
defender39 Posted October 22, 2003 Share Posted October 22, 2003 A cron option should be part of the options...maybe not the default but certainly it should be an option. Thats how I prefer to run it and it would be the easiest not only to setup and install but also it would be easy on resources. Plus I could create the cron to do it hourly. Quote Link to comment Share on other sites More sharing options...
♥auctionblox Posted October 22, 2003 Share Posted October 22, 2003 Yes, cron job is really the best option. Regarding, the user of eBay User ID: That is an option, though not secure. There would be nothing to prevent someone from checking out impersonating as that eBay user. If you have limited quantity or you sell something too cheap, then you probably don't want that option. The eBay user id can be stored in the ext_customer_id field of the auction_winners table. To use that field, you would have to change all the queries that use ext_email_address to use ext_customer_id. If you go down that path, it would be nice to have it as a configurable option so as not to break the original which allows for semi-secure checkout using email address. Quote Link to comment Share on other sites More sharing options...
Guest Posted October 22, 2003 Share Posted October 22, 2003 Yeh your probibly right. I just need to write the install file and it will be ready. Who wants to be a gueni pig? :D Quote Link to comment Share on other sites More sharing options...
ireader Posted October 22, 2003 Share Posted October 22, 2003 Hi Smitty Auctinblocks, Is this any use for the scheduling job your need :- http://www.thedemosite.co.uk/phpjobscheduler/ I downloaded it the other day. I dont fully understand what you are doing but I thought this may be something to look at good luck Ian Quote Link to comment Share on other sites More sharing options...
Guest Posted October 22, 2003 Share Posted October 22, 2003 Smitty1 I am very interested in this and would be glad to take a install and see what happens. Regards Tom Quote Link to comment Share on other sites More sharing options...
Guest Posted October 23, 2003 Share Posted October 23, 2003 Hello it's done. You can get it here: http://www.oscommerce.com/community/contributions,1577 The Auto Update Let me know what you think. Constructive criticism is a good thing. :huh: Hi Smitty Auctinblocks,Is this any use for the scheduling job your need :- http://www.thedemosite.co.uk/phpjobscheduler/ I will have to check it out. I want it to run a php script once or twice a day. :D :D Quote Link to comment Share on other sites More sharing options...
Guest Posted October 23, 2003 Share Posted October 23, 2003 Does this play well with auctioblox's auction management contrib? If not, can you give a install file for getting it to work in conjuction with it? Thanks! Quote Link to comment Share on other sites More sharing options...
Guest Posted October 23, 2003 Share Posted October 23, 2003 Does that mean I need to add bider's email myself? It works greatly except for the email. Quote Link to comment Share on other sites More sharing options...
Guest Posted October 23, 2003 Share Posted October 23, 2003 Yes, it works good, but the emails are not updated, it seems to add the last one you manually gets added to all of them :( . Also I am having trouble with the invioce button, when in the active auctions screen, it is linking to a page not found, did I do something wrong, or is everyone getting this. Doug Quote Link to comment Share on other sites More sharing options...
Guest Posted October 23, 2003 Share Posted October 23, 2003 I installed the ebay manager tonight. I will keep you posted.. and I want to thank you all so very very much.. You all rock Naomi :D Quote Link to comment Share on other sites More sharing options...
Guest Posted October 23, 2003 Share Posted October 23, 2003 To get the winner email, the system should require ebay password. Since we are not required the password, the system will not update the email. I think. It's still good. I can do the email currently. I am testing it on MS1. My catalog's default Currency is CAD, but I am listing my products at ebay using USD. When I set up the price in admin zone, the price is set up to CAD. But it is listed in USD. Should the program have a currency option or should it read from ebay which currency it is? Or can I just modify some code so that it will be set to USD only? Thanks. Quote Link to comment Share on other sites More sharing options...
Guest Posted October 23, 2003 Share Posted October 23, 2003 The get auction info contributions springs up this error: 1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'virginator' tshirt L@@K!!', NULL , '1', '0.0000', 'GBP 9.99', ' INSERT INTO auction_basket ( `auction_basket_id` , `auction_house_id` , `auction_item_id` , `ext_id` , `auction_winner_id` , `listing_status` , `time_start` , `time_end` , `orders_id` , `ext_title` , `ext_desc` , `quantity` , `price_start` , `price_end` , `insurance` , `shipping` , `sales_tax` , `products_id` ) VALUES ('', '1', '0', '2863749479', '1', '2', '2003/10/18 3::', '2003/10/25 14:10:49', NULL , 'Gothic 'virginator' tshirt L@@K!!', NULL , '1', '0.0000', 'GBP 9.99', '0.0000', '0.0000', '0.0000', '713') [TEP STOP] Does anyone know why it would do this? I can only think that It might eb the ' in the product description. PLEASE HELP! Quote Link to comment Share on other sites More sharing options...
♥auctionblox Posted October 23, 2003 Share Posted October 23, 2003 Definitely the ' in the description. The DB entity needs to be escaped in the code with another single apostrophe. The best way to accomplish this is to replace all single apostrophes in your string (in the code) with 2 apostrophes before placing it in your SQL. Quote Link to comment Share on other sites More sharing options...
defender39 Posted October 24, 2003 Share Posted October 24, 2003 ok...I have the same problem with a title that has a ' in it....so how exactly do we fix this? What code...where....how? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.