
j0k3r
Deleted
Aug 28, 2000, 10:24 PM
Post #2 of 3
(2452 views)
|
Re: adds an image/banner to auction sites
[In reply to]
|
Can't Post
|
|
This is a quick script that I use to get the auction numbers of the items I'm selling on ebay. It's a start to your script. The rest of your script can be done using more of the LWP mod. It is just automating form submission. You’re just bypassing the log in form and sending the variables need straight to the CGI program. If I have time I will dig up an example for you. ~JpT~ #!/usr/bin/perl use LWP::UserAgent; # Variables $user="***your ebay user name***"; print getauctions($user); exit; sub getauctions { my $user=$_[0]; my ($hdrs, $url, $req, $ua, $resp, @shtemp, $temp, @stemp, $id, @html); $hdrs = new HTTP::Headers(Accept => 'text/plain',User-Agent => 'JpTools 1.0'); $url = new URI::URL("http://cgi6.ebay.com/aw-cgi/eBayISAPI.dll?ViewListedItems&userid=$user&include=0&since=-1&sort=2"); $req = new HTTP::Request(GET, $url, $hdrs); $ua = new LWP::UserAgent; $resp = $ua->request($req); if ($resp->is_success) { @shtemp=split/\n/,$resp->content; foreach $temp (@shtemp) { if ($temp=~/eBayISAPI\.dll\?ViewItem/) { $temp=~s/<tr><td>//g; $temp=~s/>.*/>/g; @stemp=split/=/,$temp; $id=$stemp[2]; $id=~s/">//g; push (@html,$id); } } } else { print "Error accessing ebay"; exit; } return @html; }
|