[wellylug] Broadband - cabletraffic script

David Antliff dave.antliff at paradise.net.nz
Thu Aug 12 08:24:08 NZST 2004


On Thu, 12 Aug 2004, Tony Wills wrote:
>
> I get value for money, out of my 256k/10240 MB plan:
> 9566, 10130, 9664, 9756, 10195, 10253, 10120, 9567 (monthly usage)
> But it was a real pain there for a while because the traffic statistics
> update would slow to a crawl and was at one stage 5 days behind (the bonus
> though was that occasionally it died altogether and I go a few free traffic
> days :-)  -- seems to be sort of fixed now.

This reminds me - about a year ago I knocked this up:

http://homepages.paradise.net.nz/daveantl/cabletraffic

It's a perl script that queries the Paradise usage webpage and tells you
some useful stats about the current billing period. My Perl back then was
a bit rough (look at those significant figures go!) and it could do with
some work, but it tells me what I need to know.  E.g:

$ cabletraffic
Traffic totals at 08:16:20 2004-08-12
 For period 2004-07-19 to 2004-08-18:
  International : 9796.85
  National      : 1579.14
  Total         : 9954.76
  Remaining     : 285.24
  Days used     : 24
  Mean/day used : 414.781666666667
  Days left     : 7
  Mean/day left : 40.7485714285714


Yikes, better watch those downloads...

It uses wget which looks for username and password in ~/.netrc:

machine www.paradise.net.nz
login _______
password ______

It also uses html2text.

I am considering changing it to use LWP but I haven't got around to it and
as it stands it works fine. Feel free to use/modify/distribute (GPL2).

-- 
David.




More information about the wellylug mailing list