Reputation: 53
I'm using this URL to retrieve facebook feed of certain user: https://graph.facebook.com/{id}/feed?access_token={access_tocken}
and then getting all the photos by searching for type "photo" and searching for type "status" or "link" and take the "message" of them.
the problem is that some of the result are posts that the user posts on closed group or something else that is private and not shows on the user public wall. it also return posts that other users wrote on his wall.
and the question is: what i need to change there so that the returned results will include only(!) pictures that the user uploaded or taged on then, links that the user posted and statuses that the user posted on his public wall... and nothing else...???
Thanks.
this is part on my code that handle all of this:
$graph_url = "https://graph.facebook.com/" . $facebook_id . "/feed?access_token=" . $facebook_at;
$facebook_feeds = json_decode(file_get_contents($graph_url),true);
$facebook_feeds = $facebook_feeds['data'];
$fbIndex = 0;
foreach ($facebook_feeds as $facebook_feed)
{
$feed = new Feed();
$feed->network = 'facebook';
$feed->type = $facebook_feed['type'];
$feed->timestamp = strtotime($facebook_feed['created_time']);
if ( $feed->type == 'photo')
$feed->content = str_replace("_s.jpg", "_b.jpg", $facebook_feed['picture']);
else if (($feed->type == 'status' || $feed->type == 'link') && !empty($facebook_feed['message']))
$feed->content = $facebook_feed['message'];
else
continue;
$feeds[] = $feed;
if (++$fbIndex == 10)
break;
}
Upvotes: 2
Views: 2662
Reputation: 96151
and the question is: what i need to change there so that the returned results will include only(!) pictures that the user uploaded or taged on then, links that the user posted and statuses that the user posted on his public wall... and nothing else...???
You could see if the newly introduced feature of Field Expansion can help you with that;
Otherwise, the API does not allow much “filtering” – if you want more control in this regard, you might have to switch to FQL to get the data.
Upvotes: 2