<?xml version="1.0"?>
<!DOCTYPE content [ <!ENTITY nbsp " "> ]>
<rdf:RDF xml:base="http://snarfed.org/rdf"
         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:dc="http://purl.org/dc/elements/1.1/">

<rdf:Description rdf:about="http://snarfed.org">
  <dc:title> snarfed.org  </dc:title>
  <dc:description> draw group stream of consciousness </dc:description>
  <dc:creator> Ryan Barrett &lt;snarfed at ryanb dot org&gt; </dc:creator>
  <dc:language> en </dc:language>
  <dc:format> text/html </dc:format>
  <dc:rights> Copyright 2002-2007 Ryan Barrett </dc:rights>
</rdf:Description>

<rdf:Description rdf:about="http://snarfed.org/space/simonitor">
  <dc:title> simonitor </dc:title>
  <dc:creator> Ryan Barrett &lt;snarfed at ryanb dot org&gt; </dc:creator>
  <dc:date> 2007-02-22T21:55:00Z </dc:date>
  <dc:language> en </dc:language>
  <dc:format> text/html </dc:format>
  <dc:rights> Copyright 2002-2007 Ryan Barrett </dc:rights>

  <content>
    <p><a href="http://www.simon.com/giftcard/"><img src="/space/simon_giftcard.jpg" alt="simon_giftcard.jpg" title="" /></a></p>

<p><em>Updated 12/20/2007.</em></p>

<p>For privacy reasons, I use
<a href="/space/privacy+through+prepaid+credit+cards">prepaid debit cards</a> instead of
credit cards. Right now, I mostly use
<a href="http://www.simon.com/giftcard/">Simon gift cards</a>.</p>

<p>Like most prepaid card web sites,
<a href="http://www.simon.com/giftcard/card_balance.aspx">Simon's</a> 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.</p>

<p><a href="/space/simonitor.sh">simonitor.sh</a> is a shell script that fetches the
available balance, expiration date, and address (if registered) for one or more
<a href="http://www.simon.com/giftcard/">Simon gift cards</a>. It uses
<a href="http://curl.haxx.se/">curl</a> to POST each card number and CCV to <a href="http://www.simon.com/">Simon's web
site</a>, then handles the cookies, follows links, and
screen scrapes the resulting HTML.</p>

<p>Here's an example run:</p>

<div class='p-shadow'><pre><code>$ 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
$
</code></pre></div>

<p><br class='clearing' />Simon uses a <a href="http://www.google.com/search?q=define%3Acaptcha">CAPTCHA</a> 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.</p>

<p>Naturally, Simon tweaks their web site every now and then, which breaks this
script. When they do, I've found the
<a href="http://livehttpheaders.mozdev.org/">Live HTTP Headers</a> Firefox plugin
indispensable for capturing the actual requests and POST data sent over the
wire.</p>

<p>I briefly considered writing a <a href="http://greasemonkey.mozdev.org/">Greasemonkey</a>
script, but I have a small brain, and the shell script was simpler and didn't
need a browser.</p>

<p>See also:</p>

<ul>
<li><a href="/space/privacy+through+prepaid+credit+cards">privacy through prepaid debit cards</a></li>
<li><a href="/space/faking out address and credit card forms">faking out address and credit card forms</a></li>
<li><a href="/space/view evites anonymously">view evites anonymously</a></li>
<li><a href="/space/kodak picturecenter hacks">kodak picturecenter hacks</a></li>
<li><a href="/space/change firefox's saved passwords">change firefox's saved passwords</a></li>
</ul>

  </content>

  <rdf:Seq>

  </rdf:Seq>
</rdf:Description>
</rdf:RDF>
