Fetch numbers from within an account?

Get how many MB used (this is after login into the site, using php?)

Page 1 of 1

4 Replies - 974 Views - Last Post: 02 December 2008 - 12:43 AM Rate Topic: -----

#1 Techno Guy  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 29
  • Joined: 27-May 08

Fetch numbers from within an account?

Post icon  Posted 30 June 2008 - 01:53 AM

I want to make or edit a existing php script that will do the following:
1, it will go to a site url (http://www.orcon.net.nz/my_orcon/) then insert username + password so it longs into my account.
2, then to click on a dynamic link:
This is the code for where the link is in, could a script be able to find the word "Broadband Authentication" and then go to the link before that?
<tr> <!-- UBS -->
<td class="panel_bodyleft"></td>
<td class="panel_body" width="1%"><a href="/cgi-bin/WebObjects/OSM.woa/1102/wo/GyeGRY1K5mCt2xy4vYgkj0/1.45.3.5.0.0.9.OcnSplash.0.16.18.23.1.3.0"><IMG src="/appearance-v2/default/general_usage.gif" border="0"></a></td>
<td class="panel_body">
	<a href="/cgi-bin/WebObjects/OSM.woa/1102/wo/GyeGRY1K5mCt2xy4vYgkj0/1.45.3.5.0.0.9.OcnSplash.0.16.18.23.1.5.0">Broadband Authentication</a>
	
	&nbsp;(<I>Surfer Broadband</I>)
	
	</td>
<td class="panel_body" width="1%"></td>
<td class="panel_body" width="1%"><a href="/cgi-bin/WebObjects/OSM.woa/1102/wo/GyeGRY1K5mCt2xy4vYgkj0/1.45.3.5.0.0.9.OcnSplash.0.16.18.23.1.15.0"><IMG src="/appearance-v2/default/general_more.gif" border="0"></a></td>
<td class="panel_bodyright"></td>
</tr>


3, Then find the words "Total data:" and take the "8.70" and store it in mysql or just remember it....
<tr>
	<td class="gen_subhead" colspan="3">2008-06-23  <IMG src="/appearance-v2/default/sm_arrow_right.gif" border="0"> 2008-07-22</td>
	<td class="gen_subhead" colspan="4" align=right>Total time: 188.20 hours</td>
	<td class="gen_subhead"></td>
	<td class="gen_subhead" colspan="5" align=right>Total data: 8.70 GB</td>
	
		<td class="gen_subhead" colspan="5"></td>
	
	<td class="gen_subhead" colspan="2"></td>
</tr>

4, Then logout from site (optional)
5, Then to display the number 8.70 on my home page?

Is this possible?
Can php do this or does it need a different programming language?

Many thanks for any help you can provide.

Is This A Good Question/Topic? 0
  • +

Replies To: Fetch numbers from within an account?

#2 joeyadms  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 41
  • View blog
  • Posts: 178
  • Joined: 04-May 08

Re: Fetch numbers from within an account?

Posted 30 June 2008 - 10:17 AM

This is all possible, the best way to do it would be to use cURL .

Just get the action="" from the login page, and send your POST variables there to be logged in, then after logging in , request the page with the link on it, and use iteration or regex to find your link, follow the link and again iteration or regex to find your number.

Store that in a var and your set to go.

http://www.php.net/cURL
Was This Post Helpful? 1
  • +
  • -

#3 akozlik  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 90
  • View blog
  • Posts: 797
  • Joined: 25-February 08

Re: Fetch numbers from within an account?

Posted 01 July 2008 - 11:23 AM

Here's an excellent cURL/libcURL tutorial

http://devzone.zend....ibcurl-with-PHP

It might be about time to write one up for DIC
Was This Post Helpful? 1
  • +
  • -

#4 Techno Guy  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 29
  • Joined: 27-May 08

Re: Fetch numbers from within an account?

Posted 10 July 2008 - 06:54 PM

Thanks for your replies!

Sorry for my late reply, I was busy with another of my projects, but I hope to get started on this one in the few days :)
Was This Post Helpful? 0
  • +
  • -

#5 Techno Guy  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 29
  • Joined: 27-May 08

Re: Fetch numbers from within an account?

Posted 02 December 2008 - 12:43 AM

At last I have gotten what I wanted when I first started this Topic, it wasn't thou using cURL (altho me and a few friends did get some working code), but no there is a much better way now, my new ISP that I switch to is very nice and has kindly set up a output feed in CVS format that updates every 30 mins, so I am using that now, and with some help from google docs and some guys on my ISP's forum I have gotten a nice little self updating site which shows all the things i need.

Final result (made it into a widget too for my mac)
Posted Image
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1