My favorites | Sign in
Logo
             
Code license: MIT License
People details
Project owners:
  jesse.collis

Optus Broadband Scraper Class b0.3 by Jesse Collis jesse.collis@gmail.com

This purpose of this project is to make some headway in getting back the now defunct XML and text files that people were using to access their broadband usage from 3rd party tools and applications.

Development for this project will be ongoing and is hosted @ http://code.google.com/p/optusscrape/ Please direct any feedback to me directly, or onto the Google code bug tracker.

Initial Notes

USE THIS AT YOUR OWN RISK

Requirements

Basic Usage

  1. Initialise the class with your username and password.
EG: $myUsage = new OptusnetScraper('username','password');
  1. You can then access your various usage details directly from $myUsage.
EG: echo $myUsage->data_used;
  • NB: For a list of available parameters, use the utility function params().
  • To view the contents of the returned array use var_dump().
EG: (array) $myUsage->params();

Generating XML

Using the $domdocument instance variable will return an instance of the DOMDocument class with all the elements initialised that are mentioned in the params() function.

EG: $myUsage->domdocument;

There's lots you can do from here, like saving the XML to a file or outputting it to the browser. All the more advanced options are listed neatly in the PHP Documentation.

I have included one useful method that will return an XML string or output XML directly to the browser. It's default is to return the string. If you want proper XML headers and automatic output then pass TRUE as the first parameter.

EG: $myUsage->outputXML(true); This will output the XML to the browser

The line above will output the following by default.

If you want to leverage this class to feed XML into another application then simply learn to use the DOMDocument Class. @ http://au.php.net/manual/en/class.domdocument.php









Hosted by Google Code