Question

I'm syncing Facebook comments to a database and showing the Facebook comment box on a webpage. There are some inconsistencies with what is synced and what is shown in the Facebook comments box.

First I'm getting the comments with an FQL query. The FQL is as follows:

SELECT post_fbid, fromid, object_id, text, time FROM comment WHERE object_id in 
(SELECT comments_fbid FROM link_stat WHERE url = 'http://www.storaensometsa.fi/metsa-ja-mina/')

If you run the query in Facebook Graph API Explorer it returns two comments.

Now, if I add a Facebook comment box to the page above (http://www.storaensometsa.fi/metsa-ja-mina/) it shows zero comments (scroll down the page to see the comment box).

Any thoughts why this is happening? Shouldn't there be two comments in the comment box also? Is the FQL query somehow incorrect?

Was it helpful?

Solution

Why really is FQL necessary? You have to write such a complex query to get the comments, where you can easily get them using the Graph API /comments. Here's the API call:

/comments?id={url}

So to get the comments from your url, simply \GET:

http://graph.facebook.com/comments?id=http://www.storaensometsa.fi/metsa-ja-mina/

(you can check the result in the browser)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top