Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Help! How to access Facebook page source with php?

General discussions related to php

Moderators: macek, egami, gesf

Help! How to access Facebook page source with php?

Postby stw123456789 » Wed Nov 14, 2012 4:46 am

Hello!

Does anyone know how i can access Facebook page sources with php using WAMP Server? I tried the following lines but they kept bringing me to some Facebook page telling me to "Update Your Browser".

$hey = fopen("http://facebook.com/TheStraitsTimes/posts/439530616108591", "r");
while (!feof($hey))
{
$line = fgets($hey);
echo $line;
}

However, i know its not a browser problem because i can access Facebook normally on my computer and the exact same lines work when i use an online hosting service.

Please help me!! Thanks in advance!
stw123456789
New php-forum User
New php-forum User
 
Posts: 2
Joined: Wed Nov 14, 2012 4:38 am

Re: Help! How to access Facebook page source with php?

Postby egami » Wed Nov 14, 2012 4:11 pm

ahh, young grasshopper... Facebook requires... authentication.
User avatar
egami
php-forum GURU
php-forum GURU
 
Posts: 2197
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: Help! How to access Facebook page source with php?

Postby stw123456789 » Wed Nov 14, 2012 7:03 pm

Oh I don't think its the authentication problem. But i figured it wasn't a good idea after re-reading the FB TOS. Thanks anyway!
stw123456789
New php-forum User
New php-forum User
 
Posts: 2
Joined: Wed Nov 14, 2012 4:38 am

Re: Help! How to access Facebook page source with php?

Postby seandisanti » Thu Nov 15, 2012 8:53 am

You know you can write facebook apps too though, right? just sign up as a developer and start using their api to do what you wanted to scrape
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 773
Joined: Mon Oct 01, 2012 12:32 pm


Return to PHP General

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.