Monday, 12 August 2013

fetching and looping the fb newsfeed .graph api

fetching and looping the fb newsfeed .graph api

I want to design a news feed with fully functioning likes/Unlike ,share
and commenting,and of course fetching recent posts from users newfeed.Now
here is the thing,I want to check whether a user has liked a post (type is
video, photo, link or status).If a user has liked the post already, then
show unlike button, if a user has not liked, show like button.
FILES:
test.php
THE PROBLEM IS that whenever i remove the following code(Which gets the
user_likes for checking if user has liked the post or not)from the file:
$fql = 'SELECT like_info FROM stream WHERE post_id =' . "$ids";
$ret = $facebook->api(array(
'method' => 'fql.query',
'query' => $fql,
));
$checklike = $ret['data']['like_info']['user_likes'];
the program will fetch only one post from newsfeed or sometimes not at
all.Basically ,Any api calls i make inside the loop(except one for
comment),it will affect the fetching data from newfeed.IS THERE ANY
PROBLEM WITH LOOP OR SOMETHING ,PLEASE HELP AS SOON AS YOU,I APPRECIATE IT
..

No comments:

Post a Comment