Automatically Relist Unsuccessful Listings

Save time by automatically relisting items that 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"; 
          $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;

               }
               LOOP:
               foreach (@{$rsp->{SellerList}{Item}}) {
                 my %i = %$_;
                 ($id, $bidder) = @i{qw/Id HighBidder/};
              if ($bidder->{User}{Email} !~ "\@") { 
                 open (INFILE,"$localdir/$localfile"); 
                   while ( $line = <INFILE> ) {  
                    if ($line eq "$id\n") { last LOOP; } 
                   } 
               close (INFILE);

 my $rsp = call_api({Verb => 'RelistItem', ...

Get eBay Hacks, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.