Net::Comcast::Customer - Comcast Customer Central web interface
Access Comcast's Customer website.
my $c = Net::Comcast::Customer->new();
# Get data usage in gigabytes.
my $usage = $c->get_usage;
my $budgeted = $c->get_budgeted_usage;
Comcast Customer Central is "The one place where you can view and pay your bill, and manage all your Comcast product features and settings." Since Comcast has a 250 GB/month data cap, this module will allow you to view your total bandwidth used and your current "budgeted" bandwidth. The data is suitable for exporting into monitoring tools like RRDtool and Cacti.
In other words, this module is a programmatic interface to what you can see at https://customer.comcast.com/Secure/UsageMeterDetail.aspx .
This module could do much more (patches welcome). Also, Comcast apparently breaks this all the time, so good luck!
No args, just create and go.
Get/Set the debug level. Takes one argument: an integer.
Use this if you're having problems. Set this to zero to silence all debugging (the default).
Returns an integer.
WWW::Mech accessor. You probably won't need to use this in your own code.
Returns a WWW::Mechanize object.
Monthly Gigabyte limit accessor. Defaults to 250.
Comcast has plans to change this to 300 in the future. Read more on the "Comcast blog entry" and "Comcast FAQ page" .
Log in to Comcast's customer service portal. Takes two arguments: a username string and a password string.
Get your data usage in GB. You must log in first with login().
Returns an integer, or undef if the data could not be found.
Get your budgeted data usage in GB. For planning purposes, you'll want to correlate this value with what you get from get_usage().
Each month Comcast resets their counters to zero. If your cap is 250 GB/month, then on the first day of the month, you should use about 8 GB. After the second day of the month, your usage should be up to 16 GB. After the third day, 24 GB. And so on...
This get_budgeted_usage() method does the math for you. Using localtime(), it will figure out how much bandwidth you should have used right now. If you graph this value, it will give you a trend line that will help you know how well you're doing at staying under your limit.
This method returns a value with a resolution of one hour. Remember that Comcast says their system is delayed up to three hours. If you suddenly download down 10GB of data, it may not show up on their site's meter until three hours later.
Pure math, no HTTP involved.
Returns a floating point value.
Ken Dreyer, <ktdreyer at ktdreyer.com>
<ktdreyer at ktdreyer.com>
All the brave souls on the internet who have tried to scrape this bandwidth information and failed.
Comcast's "Data Usage Meter Information" documentation.
Copyright 2011 Ken Dreyer.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Net::Comcast::Customer, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.