Sarah L.
Sarah L.

Reputation: 85

How to access read_stream datas of a facebook user?

I'm currently trying to create a facebook app' (contest app'). When a user click on a picture and share it, his mail is put on a database. I'm doing that by calling a php page in the callback function of share, where i'm reading his wall feed, and compare to the pictures. But the problem is I can't seem to access his datas. Could anyone help me ? Here's my code :

<?php

include('../config/config.php');
include('../lib/facebook.php');

//Initialisation SDK PHP Facebook
$facebook = new Facebook (array(
    'appId' => FB_APP_ID,
    'secret' => FB_SECRET_ID,
    'cookie' => true,
));

// Récup si l'user est en session ou non
$user_id = $facebook->getUser();

$me = $facebook->api('/me');
$mail = $me['email'];
$feed = $facebook->api('/me/feed');
$data = $feed['data'];
$link = $data['link'];



$galant="MY_LINK";
$storyboard="MY_LINK";
$tovil="MY_LINK";
$tingapour="MY_LINK";

if($link===$galant)
{
$base=mysql_connect(BDD_HOST,BDD_USER,BDD_PASS);
mysql_select_db(BDD_NAME, $base);

$sql="insert into register(mail,link) values('$mail','$link')";
$req=mysql_query($sql);

}
?>

Thanks for your help!(And sorry for the mistakes, I'm french ^^)

Upvotes: 1

Views: 2803

Answers (1)

Mihai Iorga
Mihai Iorga

Reputation: 39704

I believe it works well. Try their tools:

http://developers.facebook.com/tools/explorer/?method=GET&path=me%2Ffeed

they work ok. Remeber that you have to request a lot of permissions to get the full feed.

Also, apigee allows you to test all Facebook features and shows you exact request.

Upvotes: 1

Related Questions