![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Web Design & Programming Discussion of web design, and server-side & client-side scripting |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Jun 2007
Posts: 58
OS: Win XP Pro
|
Web Server Access to Account
Hi, I have set myself a little project in PHP. In principle it seemed easy and the idea was that the php page I created and uploaded to my web server would access and read data from a remote web page using line-by-line regular expressions. This part of the project I believe I had achieved, but I couldnt get the thing to actually work - until I realised my problem:
The specific pages I am trying to read are a part of a facebook app and while these pages do not hold any private information, facebook (and as a result the app) does not allow access to these pages until you are logged in to an account. My question is this: Is it possible to code or control my web server to that it can log into fabebook automatically (even if it has to be my own personal account). I can achieve this on my own computer by using the 'remember me' options when I log into facebook which I assume stores cookies locally - I am wondering how I can achieve the same results with a web server. Possible ? Or any alternitive solutions out there ? I would apreciate some feed back. Regards, SG |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#2 (permalink) |
|
Registered User
Join Date: Jun 2007
Posts: 58
OS: Win XP Pro
|
Re: Web Server Access to Account
Okay, I managed to crack the access part... Now problem 2
![]() I cant get the regular expressions to match the lines, I have tried breaking it down into small chunks and taking it all in one go and I just cant get the info extracted! I am essentially reading a repeating line as follows: Code:
<tr><td class="rankingrank">A_NUMBER.</td><td class="rankingimg"><a href="index.php?id=B_NUMBER" title="C_WORD" onclick="(new Image()).src = '/ajax/ct.php?app_id=6185137361&action_type=3&post_form_id=0915a61035bf57190b23a2ee3d41e138&position=3&' + Math.random();return true;"><img uid="1060585185" size="square" linked="false" style="height: 16px; width: 16px;" src="http://profile.ak.facebook.com/v226/479/73/q1060585185_9577.jpg" alt="Text" title="Text" /></a></td><td class="rankinguser"><a href="alliance.php?al=D_NUMBER" title="E_WORD" onclick="(new Image()).src = '/ajax/ct.php?app_id=6185137361&action_type=3&post_form_id=0915a61035bf57190b23a2ee3d41e138&position=3&' + Math.random();return true;">[F_WORD]</a> <a href="index.php?id=B_NUMBER" onclick="(new Image()).src = '/ajax/ct.php?app_id=6185137361&action_type=3&post_form_id=0915a61035bf57190b23a2ee3d41e138&position=3&' + Math.random();return true;">C_WORD</a></td><td class="rankingstat">G_NUMBER</td></tr> A_NUMBER = Simple number B_NUMBER = Simple number C_WORD = Letters/numbers/spaces/asci/foreign characters - Max 100 chars D_NUMBER = Simple number E_WORD = Letters/numbers/spaces/asci/foreign characters - Max 100 chars F_WORD = Letters/numbers/spaces/asci/foreign characters - Max 4 chars - Min 0 G_NUMBER = Simple number You will notice that some areas I am trying to capture are repeated. Most of the spare parts of the line expression needs to be flexible as parts can change, like the serial codes, images - but the table structure and class tags will not change and this is what I have been trying to anchor my expressions from. In its current state I have my script broken down into chunks: Capturing A_NUMBER Code:
preg_match('(class="rankingrank">([0-9]+)\.)', $line, $data)
Code:
preg_match('(>(.+?)<\/a>\<\/td><td class="rankingstat">([0-9]+)<\/td>)', $line, $data)
Code:
preg_match('(<a href="alliance\.php\?al=([0-9]+?)" title\="(.+?)" onclick=")', $line, $data)
Can anyone highlight where I am going wrong ? Or point me in the direction of a good regex creator maybe ? Thanks in advance :) |
|
|
|
|
|
#3 (permalink) |
|
Registered User
Join Date: Jun 2007
Posts: 58
OS: Win XP Pro
|
Re: Web Server Access to Account
Okay a cracked it now. I found a VERY good web site for working on reg-ex commands and thought I would post it up here incase anyone at all is interested :P
http://gskinner.com/RegExr/ |
|
|
|
![]() |
| Thread Tools | |
|
|