Automated Jetstream Usage Meter

I wrote this program to automatically access Telecom's web-based JetStream (or JetStart) usage meter. It can be used to implement an automated warning system. AFAIK, Telecom don't provide a computer readable usage number except through the web interface.

Download

Version 0.9.3 (7 Feb 2005) I fixed it (or rather broke it) to workaround a bug in html on Telecom's site, which has been tripping up jsu for a month or two now.

Version 0.9.2 (11 Oct 2003) is now available! This is _enhanced_ since the un-numberd version I released a couple of day ago! Woohoo! Download it here (Right click on the link and select "save link as", or similar)

Usage

The program needs Python version 2.2 or later. If you don't already have it, it can be obtained from www.python.org

It was written in Debian Linux. If you're running Linux, just make the file executable and modify the first line to point to your python 2.2. The program is not specific to Linux though, it should run on anything that runs python 2.2

The program is run with two arguments, the username and password you would use to log into the JetStream usage meter website. (jsu.py username password) The program them prints some of the data from the page to stdout (this may be lost when running in windows if the "dos" box disappears too fast, I think?). The printout looks like this:

746.78 MB
34567890 - Usage for 13 Sep 2003 - 12 Oct 2003
This Meter reflects your usage up to 22:41:17
on 10/10/2003
13 Aug 2003 - 12 Sep 2003 974.40
13 Jul 2003 - 12 Aug 2003 727.05
13 Jun 2003 - 12 Jul 2003 537.01
13 May 2003 - 12 Jun 2003 758.70
13 Apr 2003 - 12 May 2003 438.20
13 Mar 2003 - 12 Apr 2003 568.22
13 Feb 2003 - 12 Mar 2003 722.51
13 Jan 2003 - 12 Feb 2003 1217.33
13 Dec 2002 - 12 Jan 2003 1168.03
13 Nov 2002 - 12 Dec 2002 1392.96
13 Oct 2002 - 12 Nov 2002 941.98

First is the all important usage number, then other details from the page, and finally the usage history table.

With usage number first, this should be easy to parse from other programs. If you want to use it as part of a larger python program, even easier, just call the main function and you are returned an object with the data as attributes.

The process takes about 7 seconds on my computer, most of that is waiting for the web pages to arrive.

TODO

It works for me as is, but if there were interest, I might put together a GUI. Let me know if this would be useful to you.

Copyright

Copyright (C) 1993 Alex King, released under the GPLv2. License here

Have fun!