Welcome to Dream.In.Code
Become a PHP Expert!

Join 150,120 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,999 people online right now. Registration is fast and FREE... Join Now!




Fetch numbers from within an account?

 
Reply to this topicStart new topic

Fetch numbers from within an account?, Get how many MB used (this is after login into the site, using php?)

Techno Guy
30 Jun, 2008 - 12:53 AM
Post #1

New D.I.C Head
*

Joined: 27 May, 2008
Posts: 16


My Contributions
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?
CODE
<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....
CODE
<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.
User is offlineProfile CardPM
+Quote Post

joeyadms
RE: Fetch Numbers From Within An Account?
30 Jun, 2008 - 09:17 AM
Post #2

D.I.C Head
Group Icon

Joined: 4 May, 2008
Posts: 162



Thanked: 8 times
Dream Kudos: 600
Expert In: PHP, Web Security

My Contributions
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
User is offlineProfile CardPM
+Quote Post

akozlik
RE: Fetch Numbers From Within An Account?
1 Jul, 2008 - 10:23 AM
Post #3

D.I.C Addict
Group Icon

Joined: 25 Feb, 2008
Posts: 714



Thanked: 30 times
Dream Kudos: 800
My Contributions
Here's an excellent cURL/libcURL tutorial

http://devzone.zend.com/article/1081-Using...ibcurl-with-PHP

It might be about time to write one up for DIC
User is offlineProfile CardPM
+Quote Post

Techno Guy
RE: Fetch Numbers From Within An Account?
10 Jul, 2008 - 05:54 PM
Post #4

New D.I.C Head
*

Joined: 27 May, 2008
Posts: 16


My Contributions
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 smile.gif
User is offlineProfile CardPM
+Quote Post

Techno Guy
RE: Fetch Numbers From Within An Account?
1 Dec, 2008 - 11:43 PM
Post #5

New D.I.C Head
*

Joined: 27 May, 2008
Posts: 16


My Contributions
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)
IPB Image
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 01:22AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month