OptusScrape – A PHP Class to scrape your optusNet usage data

OptusScrape

OptusScrape

I spent the day today writing up a php class that would give me an XML page of my optusnet usage. Previously you could hook into two pages they had running to get a text version of your usage details – but in Janurary they finally closed off the service in favor of their flashy advertising. Whirlpool link Here

Introducing OptusScrape: hosted @ http://code.google.com/p/optusscrape/ and released open source for anyone who wants to fiddle and help with ongoing maintence and development.

It has had no testing so far, and is the result of about 5 hours work – so don’t expect the world. It will probably fail badly if something goes wrong – but from my trials today it seems to work well if you have the right requirements.

It uses curl and PHP DOMXPath object to grab the elements. And returns DOMDocument objects with nice clean XML of the usage data. Thanks for FireBug for quickly getting my the XPath coords.

Next time I have time I will utilize the PHP Curl library, but for now it works well on *nix systems.

Here’s a snippit of the output and fields it supports.

Any feedback would be great!

Share this article:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • DZone
  • Furl
  • Ma.gnolia
  • NewsVine
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
This entry was posted in Programming and tagged . Bookmark the permalink.

Leave a Reply