Quantcast
Viewing all articles
Browse latest Browse all 60

fetching and looping the fb newsfeed

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.please tell me if there is any problem


Viewing all articles
Browse latest Browse all 60

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>