get friend feed by facebooksdk

<?php
include “src/facebook.php”;
$facebook =new Facebook(array(
‘appId’=>’your appid’,
‘secret’=>’secret’,
‘cookie’=>true
));
$session=$facebook->getUser();
$me=null;
//error_reporting(0);
if($session)
{
try
{
$f=$facebook->getAccessToken();
$m=$facebook->api(“1323840570/”);

$f=$facebook->getAccessToken();

print_r($m);
echo “ko”;
}catch(FacebookApiException $e)
{
echo $e->getMessage();
}
}
if($session)
{
$logoutUrl=$facebook->getLogoutUrl();
echo “<a href=$logoutUrl>Logout</a>”;
}
else
{
$loginUrl=$facebook->getLoginUrl(array(‘scope’ =>’user_photos,publish_stream,read_stream,manage_notifications,read_mailbox,user_about_me,user_birthday,user_location,email,read_friendlists,friends_location,friends_birthday’));
echo “<a href=$loginUrl>Login</a>”;
}
?>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s