Facebook Graph API 评论请求返回空数组
当我尝试使用此处描述的方法获取 Facebook Graph API 上的所有“评论”时...
http://developers.facebook.com/blog/post/490
使用下面的方法,并将 {YOUR_URL} 替换为 facebook 评论框所在页面的 URL,如下所示...
https://graph.facebook.com/comments/?ids={YOUR_URL}
我有一个返回空数组...
{
"{YOUR_URL}": {
"data": [
]
}
}
我认为这很不寻常,因为该页面上的评论框肯定有评论,但没有出现在图形 API 调用中。
我尝试使用 Graph API Explorer 工具执行相同的操作,得到相同的结果。
我认为这可能是 Graph API 的问题,因此尝试通过设置新的 Facebook 对象并运行查询,使用 FQL 和 PHP API 查询注释,如下所示。
SELECT post_fbid, fromid, object_id, text, time FROM comment WHERE object_id IN (SELECT comments_fbid FROM link_stat WHERE url ='{YOUR_URL}')
再次得到相同的结果,一个空数组。
我也尝试检查喜欢,得到相同的结果,一个空数组。
尝试对 URL 进行编码并将其放置在 API 调用和 FQL 请求上,结果相同。
我看到页面上有 facebook 评论,但我无法通过 Graph API 或 FQL 查询获取它们。
有其他人遇到过这个问题吗?您是否找到了发表评论的方法?任何想法将不胜感激。
When I try to get all my "comments" on Facebook Graph API, using the method described here...
http://developers.facebook.com/blog/post/490
using the method below and replacing the {YOUR_URL} with the URL of the page where the facebook comments box lives, like below...
https://graph.facebook.com/comments/?ids={YOUR_URL}
I have an empty array returned...
{
"{YOUR_URL}": {
"data": [
]
}
}
I though this was unusual since the comments box on that page certainly had comments, but were not appearing on the Graph API call.
I tried doing the same using the Graph API Explorer tool, with the same results.
Thinking it might be an issue with the Graph API, I tried to query the comments out with FQL and the PHP API by setting a new Facebook Object and runnign a query as follows.
SELECT post_fbid, fromid, object_id, text, time FROM comment WHERE object_id IN (SELECT comments_fbid FROM link_stat WHERE url ='{YOUR_URL}')
Once again with the same results, a empty array.
I tried ckecking for likes as well, with the same results, an empty array.
Tried encoding the URL and placing that on both the API call and the FQL request, the same results.
I see that there are facebook comments on the pages, but I am not able to obtain them through the Graph API or a FQL query.
Has anyone else come across this issue and did you find a way to get your comments out. Any ideas would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它通常有效。例如检查此链接:
https://graph.facebook。 com/comments/?ids=http://developers.facebook.com/blog/post/490
您使用的网址是什么? Facebook Graph API url 非常敏感,因此请确保您以完全相同的格式访问它(例如相同的大小写、相同的查询字符串、尾部斜杠等)。另外,检查页面上的插件是否设置了 href 或 data-href 属性,将其指向不同的位置。
It normally works. For example check this link:
https://graph.facebook.com/comments/?ids=http://developers.facebook.com/blog/post/490
What is the url you are using? Facebook Graph API url's are quite sensitive so make sure you are accessing it in the exact same format (eg same casing, same querystring, trailing slash, etc). Also, check to see if the plugin on your page is setting a href or data-href attribute pointing it to a different location.