Usage XML specification

Queries, errors or glitches regarding Member facilities
sam.adl
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, https://www.exetel.com.au/members/usage_hspa_view.php
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

https://www.exetel.com.au/hspa/hspa_usage_xml.php?login_name=04xxxxxxxx&password=YourPwd&date=2012-04-04

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <ServiceNumber>04xxxxxxxx</ServiceNumber>
  <MobileTelephoneCall>
    <CallDetails>
      <CallingDate>2012-04-04 12:47:12</CallingDate>
      <CallingFrom>04xxxxxxxx</CallingFrom>
      <CallingTo>04xxxxxxxx</CallingTo>
      <CallType>Mobile Call</CallType>
      <Duration>00:00:38</Duration>
      <Charges>$0.24</Charges>
    </CallDetails>
    <CallDetails>
      <CallingDate>2012-04-04 15:04:30</CallingDate>
      <CallingFrom>04xxxxxxxx</CallingFrom>
      <CallingTo>04xxxxxxxx</CallingTo>
      <CallType>Mobile Call</CallType>
      <Duration>00:00:34</Duration>
      <Charges>$0.21</Charges>
    </CallDetails>
  </MobileTelephoneCall>
</Response>

User avatar
Dazzled
Volunteer Site Admin
Posts: 6002
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 = 'http://www.exetel.com.au/....................'
soup = BeautifulSoup (urllib2.urlopen (url). read ())
text = soup.find(.................)

Post Reply