pqams
pqams

Reputation: 21

facebook fql retrieve comments

Show comments of every one who posted it in my page

This is giving blank page

Where am i going wrong

  FB.api({
  method: 'fql.multiquery',
  queries: {
   query1: 'SELECT post_fbid, fromid, text, time FROM comment WHERE post_id="'+postID     +'"',
  query2: 'SELECT id, name, url, pic FROM profile WHERE id IN (SELECT fromid FROM #query1)'
 }
 });
</script>
<script>
function(response) {

var comments = response[0].fql_result_set;
var users = response[1].fql_result_set;    

//loop through the comments
for(var i = 0, j = comments.length; i<j; i++){

    for(var x = 0, y = users.length; x<y; x++){
         if(comments[i].fromid == users[x].id){
             //we have a match, this comment is from user users[x]
             //process users[x]
             //break the inner for loop, since we already have a match
         }
    }

}

}

Upvotes: 2

Views: 2510

Answers (1)

Joshua Baker
Joshua Baker

Reputation: 21

Are you using the new Facebook comments (“migrated”)?

Perhaps consider using the graph API instead:

https://graph.facebook.com/comments/?ids=http://example.com/

Upvotes: 2

Related Questions