snarfed.org

draw group stream of consciousness

simonitor

Thu, 22 Feb 2007 [comments (0)] [history] [rdf] [raw]

simon_giftcard.jpg

Updated 12/20/2007.

For privacy reasons, I use prepaid debit cards instead of credit cards. Right now, I mostly use Simon gift cards.

Like most prepaid card web sites, Simon's can show your card's balance and transaction history in real time. However, it's a little tedious to navigate the site and enter the card number and CCV each time. So, I automated it.

simonitor.sh is a shell script that fetches the available balance, expiration date, and address (if registered) for one or more Simon gift cards. It uses curl to POST each card number and CCV to Simon's web site, then handles the cookies, follows links, and screen scrapes the resulting HTML.

Here's an example run:

$ simonitor.sh 9999012345789/123 8888012345789/456
Enter the captcha string: ABC123
99990123456789/123: $232.67, expires 08/2008
                    Mountain View, CA 94043
88880123456789/456: $39.91, expires 12/2008
$


Simon uses a CAPTCHA to discourage bots. This script displays the CAPTCHA image to the user, asks them for its text, and passes that text back to the site.

Naturally, Simon tweaks their web site every now and then, which breaks this script. When they do, I've found the Live HTTP Headers Firefox plugin indispensable for capturing the actual requests and POST data sent over the wire.

I briefly considered writing a Greasemonkey script, but I have a small brain, and the shell script was simpler and didn't need a browser.

See also:

Post a comment...



Simple HTML and wiki markup are allowed.