简体   繁体   中英

retrieve Facebook Comments from the URL using Graph API and FQL

I am trying to retrieve comments by given url, eg

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

However, when I substitute a link, I get an empty set, even comments exist on the page..

Wonder if it's related to oauth and if I have to provide access token or smth..I am using js, I would appreciate if you would help with any samples how to retrieve comments by URL or by commentID using FQL

UPDATE QUESTION:

How some url work with API without any tokens being passed, where other don't work?

example: http://graph.facebook.com/comments?id=http://techcrunch.com/2011/09/20/digg-experiments-with-topic-newsrooms-aggregates-news-by-most-meaningful-stories/ (works)

If the site has a comments object associated to it, you'll see the comments. Otherwise you will see what you're seeing, an empty dataset. Example ...

First, graph TimHortons ... then visit the Comments Plugin ... Enter in "TimHortons.com" in the domain ... Leave a comment ... now visit the graph TimHortons again ...

See the comments? Hope this helps.

You need to first create facebook app for your website and then include the following meta tag entry on your page:

<meta property="fb:app_id" content="{your-app-id}" />

only comments added after adding the meta tag will appear in your url.

To create an app on facebook, go to developers.facebook.com. Under Apps tab you will find an option to create the app. If you're not as yet registered as a developer, it will first ask you to register as a developer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM