简体   繁体   English

使用Graph API和FQL从URL检索Facebook评论

[英]retrieve Facebook Comments from the URL using Graph API and FQL

I am trying to retrieve comments by given url, eg 我试图通过给定的URL检索评论,例如

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 不知道它是否与oauth有关,如果我必须提供访问令牌或smth ..我正在使用js,如果你能帮助任何样本如何通过URL或使用FQL的commentID检索注释,我将不胜感激

UPDATE QUESTION: 更新问题:

How some url work with API without any tokens being passed, where other don't work? 一些url如何使用API​​而不传递任何令牌,其他哪些不起作用?

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) 例如: http//graph.facebook.com/comments?id = http://techcrunch.com/2011/09/20/digg-experiments-with-topic-newsrooms-aggregates-news-by-most-meaningful-故事/ (作品)

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 ... 首先,图TimHortons ...然后访问评论插件...在域中输入“TimHortons.com”...发表评论...现在再次访问图TimHortons ...

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: 您需要首先为您的网站创建Facebook应用程序,然后在您的页面上包含以下元标记条目:

<meta property="fb:app_id" content="{your-app-id}" /> <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. 要在Facebook上创建应用程序,请访问developers.facebook.com。 Under Apps tab you will find an option to create the app. Apps选项卡下,您将找到创建应用程序的选项。 If you're not as yet registered as a developer, it will first ask you to register as a developer. 如果您尚未注册为开发人员,则首先会要求您注册为开发人员。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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