But I digress...
The reason this script was put together was because someone posted their sl-5500 for a very low price on the buy it now feature, and it was snatched up (what I can only assume was) very quickly. This script will check to see if there are any new items in the search results, and send you an sms with the item number so you can check it out. Note that this script only searches one page, though could probably be changed to search many or all pages...
#!/usr/bin/perl
$message='sl 5500';
@rray=split ('<tr ', `curl -L 'http://tinyurl.com/yn4hkf 2>/dev/null|grep 'List View'`);
if(@rray[0]!~/script/){print "fission mailed!\n"; exit;}
$oldids=`cat sl5500.ids`;
`rm -f sl5500.ids`;
for(@rray){
if($_=~/ebLeft/){
for(split('<td ', $_)){
if(/coitem\" value="(\d+)"/){
$id=$1;
if($oldids!~/$id/){
`/home/bishop/sms.pl $message -- $id`;
}
`echo $id >> sl5500.ids`;
}
}
}
}
If you wish to make your own script, make sure you add a check like in line 3 to make sure ebay responds to you. For some reason, every 20th or so try would get a connection reset from ebay. This made no sense, so I just tossed in that check. It pretty much runs the same way my gmail notifier works. Simple is good.
No comments:
Post a Comment