Skip to Main Content
eBay Hacks
book

eBay Hacks

by David A. Karp
August 2003
Beginner content levelBeginner
368 pages
9h 38m
English
O'Reilly Media, Inc.
Content preview from eBay Hacks

Send Automatic Emails to High Bidders

Send payment instructions to your customers automatically.

Here’s a simple script that will scan all your auctions that have ended in the last 24 hours and send a payment-instructions email to each high bidder.

Tip

This script requires the email template from [Hack #74]; just place it in the directory specified by $localdir in your config.pl include file.

#!/usr/bin/perl require 'ebay.pl'; $template = "template.txt"; $today = &formatdate(time); $yesterday = &formatdate(time - 864000); 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, $title, $currency, $price, $highbidder, $checkout) = @i{qw/Id Title CurrencyId CurrentPrice HighBidder Checkout/}; $bidderemail = $highbidder->{User}{Email}; if ($bidderemail =~ "\@") { $shipping = $checkout->{Details}{ShippingHandlingCosts}; $total = $price + $shipping; open(MAIL,"|/usr/sbin/sendmail -t"); print MAIL "To: $bidderemail\n"; print MAIL "From: $selleremail\n"; print MAIL "Reply-To: $selleremail\n"; print MAIL "Subject: $title\n\n"; open (COVER, "$localdir/$template"); while ( $line = <COVER> ) { if ($line eq "<insert title here>\n") { print MAIL $title; } elsif ($line eq "<insert item here>\n") { print MAIL $id; } elsif ($line eq "<insert ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

eBay Hacks, 2nd Edition

eBay Hacks, 2nd Edition

David A. Karp

Publisher Resources

ISBN: 0596005644Catalog PageErrata