comcap.py - Comcast internet usage script
TweetThis thread has moved to my new site here: http://pyhacker.com/archive2011/comcappy-comcast-internet-usage-script/
Yesterday I wrote a little python script that grabs your current Comcast
internet usage and prints it to stdout. It depends on the
excellent mechanize module so if you don't have it, install it with
easy_install.py mechanize.
To run the script, simply execute comcap.py. You will be prompted for your
Comcast username and password. Alternatively, you can create an entry in your
~/.netrc file with your Comcast credentials. The entry should look like:
machine login.comcast.net login username@comcast.net password password
where username is your Comcast username and password is your Comcast
password.
I'll be running this in a cron job every few days to monitor my usage and send a warning email to myself if the usage gets near the limit. Hopefully someone else will also find this useful!