Usage XML specification

Queries, errors or glitches regarding Member facilities
Posts: 18
Joined: Wed Aug 05, 2009 11:01 pm

Re: Usage XML specification

Post by sam.adl » Wed Aug 29, 2012 4:53 pm

Dazzled wrote:sam.adl, you haven't mentioned the platform, and I don't know if you can script, so if that's out of the question, read no further.

If you already have a working script to get the XML, you could just add a line to do the total and subtraction and show only the result. Otherwise you could GET the user facility page, search for the summary line, and display it only. The latter method has the usual disadvantage that it would need re-writing if Exetel changes the page.
Hey Dazzled,

I already have a PHP script to grab my DSL usage and show that on a webpage.
What I was after was being able to track my mobile cap usage in a similar fashion.

Below is the Mobile XML usage I was supplied by exetel, but it only shows individual calls, not a total value. so without grabbing it for every single day and summing the call details I don't see it of any use. I might try the GET of the user facility page and extract the information from there. Thanks for the idea :)

this will be the page I scrape the data from,
I will just have to figure out all the get variables I need to use on it (I also have a few mobile cap plans on the one account).

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
      <CallingDate>2012-04-04 12:47:12</CallingDate>
      <CallType>Mobile Call</CallType>
      <CallingDate>2012-04-04 15:04:30</CallingDate>
      <CallType>Mobile Call</CallType>

Volunteer Site Admin
Posts: 6018
Joined: Mon Nov 13, 2006 1:16 pm
Location: Sydney

Re: Usage XML specification

Post by Dazzled » Wed Aug 29, 2012 9:22 pm

Scraping html is much simplified if you use Beautiful Soup, as you can go straight to the element with almost no work. eg:
import urllib2, sys
from bs4 import BeautifulSoup

url = ''
soup = BeautifulSoup (urllib2.urlopen (url). read ())
text = soup.find(.................)

Post Reply