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:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* 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
Go Back   Tech Support Forum > Design Forum > Web Design & Programming
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Web Design & Programming Discussion of web design, and server-side & client-side scripting

Reply
 
LinkBack Thread Tools
Old 12-12-2008, 01:20 PM   #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
funkyGibbon is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
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

Old 12-15-2008, 04:19 PM   #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&amp;action_type=3&amp;post_form_id=0915a61035bf57190b23a2ee3d41e138&amp;position=3&amp;' + 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&amp;action_type=3&amp;post_form_id=0915a61035bf57190b23a2ee3d41e138&amp;position=3&amp;' + Math.random();return true;">[F_WORD]</a> <a href="index.php?id=B_NUMBER" onclick="(new Image()).src = '/ajax/ct.php?app_id=6185137361&amp;action_type=3&amp;post_form_id=0915a61035bf57190b23a2ee3d41e138&amp;position=3&amp;' + Math.random();return true;">C_WORD</a></td><td class="rankingstat">G_NUMBER</td></tr>
And I am trying to extract the following:
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)
Capturing C_WORD & G_NUMBER
Code:
preg_match('(>(.+?)<\/a>\<\/td><td class="rankingstat">([0-9]+)<\/td>)', $line, $data)
Capturing D_NUMBER & E_WORD
Code:
preg_match('(<a href="alliance\.php\?al=([0-9]+?)" title\="(.+?)" onclick=")', $line, $data)
These are capturing some parts correctly, but failing on a majority of lines and capturing too much of the lines. I tried adding the ? greedy flag with no better luck.

Can anyone highlight where I am going wrong ? Or point me in the direction of a good regex creator maybe ?

Thanks in advance :)
funkyGibbon is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 12-20-2008, 07:43 AM   #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/
funkyGibbon is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 03:00 AM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85