Retrieve all comments with FQL by application ID

2019-07-29 11:51发布

问题:

We use the facebook comment plugin to have comments on our site.

To moderate those, we use this tool: https://developers.facebook.com/tools/comments

However, we want to build our own tool to moderate those comments, and integrate it to our existing software.

I can't find a proper way of doing this. the only way I found out now after hours of research is this FQL query:

select post_fbid, fromid, object_id, text, time from comment where object_id in (select comments_fbid from link_stat where url ='URL_HERE')

That doesn't work because we have thousands of different URL's and I cant query each of them every time to see if there are any new comments.

I need a way to get all (new) comments by just enter our app_id, domain or something like that

How can I do this?

回答1:

I'm considering doing the same thing- grabbing all user posts for my application. I'm assuming it's a similar task.

For given user, I will scroll through feed and home looking for app posts. For you, you'd go:

`home?fields=comments`
`feed?fields=comments`

And check for "type" and "id" to match your application.



回答2:

This code queries for all comments xids used by your application:

https://graph.facebook.com/fql?q=SELECT fromid, text, id, time, username, xid, object_id FROM comment WHERE xid IN (SELECT xid FROM comments_info WHERE app_id = {0}) ORDER BY time desc&access_token={1}&format=json