August 2003
Beginner
368 pages
9h 38m
English
Save time by automatically relisting auctions that have received no bids or have a reserve that wasn’t met.
Most of the time, when an auction ends without receiving any bids or with a reserve that wasn’t met, sellers end up relisting the item. But this can be rather laborious, especially if you have more than a few auctions to relist.
The following script will relist for you, and when run on a regular basis, say, every day, you’ll never have to manually relist an auction again.
#!/usr/bin/perl require 'ebay.pl'; $localfile = "autorelist.txt"; [1] $today = &formatdate(time); $yesterday = &formatdate(time - 86400); my $page_number = 1; PAGE: while (1) { my $rsp = call_api({ Verb => 'GetSellerList', DetailLevel => 8, UserId => $user_id, EndTimeFrom => $yesterday, EndTimeTo => $today, PageNumber => $page_number }); if ($rsp->{Errors}) { print_error($rsp); last PAGE; } foreach (@{$rsp->{SellerList}{Item}}) { my %i = %$_; ($id, $bidder) = @i{qw/Id HighBidder/}; if ($bidder->{User}{Email} !~ "\@") { [2] open (INFILE,"$localdir/$localfile"); while ( $line = <INFILE> ) { if ($line eq "$id\n") { goto SKIP; } [3] } close (INFILE); my $rsp = call_api({Verb => 'RelistItem', [4] DetailLevel => 0, SiteId => $site_id, ItemId => $id }); if ($rsp->{Errors}) { print_error($rsp) } else { print "Relisted item $id as #$rsp->{Item}[0]{Id}\n"; open (OUTFILE,">>$localdir/$localfile"); print OUTFILE "$id\n"; [5] close (OUTFILE); } } } SKIP: last PAGE unless $rsp->{SellerList}{HasMoreItems}; ...