我一直在谷歌搜索和堆栈拖钓这样的事情,但似乎找不到正确的公式,所以我想我会问...。
我想做的是使用Graph API而不是FQL-我们的应用程序已经运行了php / graph api调用,希望将它们保持在一起。
这是FQL:
SELECT url,
normalized_url, share_count, like_count, comment_count,
total_count,commentsbox_count, comments_fbid,
click_count FROM link_stat WHERE url='http://www.google.com'
尝试了一堆不同的东西,似乎无法翻译-我将假设在图API中不存在Link_stat,因为上面没有文档。
弄清楚是否有人可能做到了。
我想要的样品
https://graph.facebook.com/XXXXX/?ids=http:google.com ( somethin like that )
我认为不可能从图形API中获得计数,您应该使用FQL link_stat表。不建议使用FQL。
您可以尝试使用,
http://graph.facebook.com/?id=http://www.google.com
它会返回结果,
{
"id": "http://www.google.com",
"shares": 7991103,
"comments": 807
}
编辑
https://developers.facebook.com/docs/reference/fql/
自2016年8月17日起,FQL将不再可用,无法查询。要迁移您的应用,请使用API升级工具查看您可以进行的Graph API调用。
https://graph.facebook.com/fql?q=SELECT%20url,%20normalized_url,%20share_count,%20like_count,%20comment_count,%20total_count,commentsbox_count,%20comments_fbid,%20click_count%20FROM%20link_stat%20WHERE%20url='http://www.google.com'
这会回来,
{
"data": [
{
"url": "http://www.google.com",
"normalized_url": "http://www.google.com/",
"share_count": 4989540,
"like_count": 1317162,
"comment_count": 1684401,
"total_count": 7991103,
"commentsbox_count": 807,
"comments_fbid": 396269740024,
"click_count": 265614
}
]
}
目前不建议使用REST API方法。
http://api.facebook.com/restserver.php?method=links.getStats&urls=http://www.google.com
请注意:Facebook不赞成使用REST API https://developers.facebook.com/blog/post/616/最好选择Graph API / FQL方法。
参考链接:通过API检索Facebook共享计数
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句