bbbUM (BendBroadBand Usage Monitor)

Posted on July 20, 2008

As of July 1st 2008, BendBroadBand (my ISP) now limits their customers monthly usage to 100GB. Should you go over this amount, they will charge you $1.50 per GB. In order to monitor this, BendBroadBand allows you to login to their website to track your usage. I was getting sick of logging in everyday, so I decided to tackle the problem with some OOP (object oriented programming) using PHP5, PEAR::Mail, and some regular expressions. I ended up creating bbbUM, as in “Dude, I have to monitor my internet usage and I’m totally bbbUM’ed”. This sweet little program runs once a day as a cron job and sends a text message to my cell phone that contains my current usage.

The file that needs to be executed (should it not be obvious) is the bbbMail.php. For the sake of clarity, I have written the 3 variables that you will need to change in bold.

bbbUM Version 1.0

<php
 
//you need PEAR::Mail installed for this to work
require_once('Mail.php');
 
//path to the bbbClass.inc.php file
require_once('bbbClass.inc.php');
 
//create new bbb object
$obj = new bbbUM;
 
//email where you wish the message sent
$obj->setEmail('5415551212@vtext.com');
 
//bbb username/email
$obj->setUserName('jdoe@bendbroadband.com');
 
//password
$obj->setPassword('123456');
 
//method that sends mail
$obj->bbbSend();
 
?>