jmhobbs@pyhacker /posts/comcappy-comcast-internet-usage-script

date
2011-04-21T08:37:34.000Z

whoami
jmhobbs

ls
comments content tags

wc content
133

cat content

comcap.py - 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!

Find the code here: comcap.py

wc tags
bandwidth   comcast   internet   mechanize   usage  

cat comments