gpt4 book ai didi

ajax - 点赞按钮显示我的点赞数,但在 facebook api 中不可见

转载 作者:行者123 更新时间:2023-11-30 05:27:36 24 4
gpt4 key购买 nike

如果我去https://developers.facebook.com/docs/plugins/like-button/并输入 https://www.ballantinesbarproject.fr/?name=epicerie并选择 box-count 作为布局。正如预期的那样,点赞按钮显示点赞次数,因为我喜欢该页面。但是,如果我查看 facebook api:

休息: https://api.facebook.com/method/links.getStats?urls=https://ballantinesbarproject.fr/?name=epicerie&format=json

最终质量等级: https://graph.facebook.com/fql?q=select%20url,%20like_count%20from%20link_stat%20where%20url=%22https://ballantinesbarproject.fr/?name=charlatan%22

(虽然一位用户声称,他可以在 fql-api 中看到计数)

它说有 0 个赞。怎么会?

最佳答案

以下查询是正确的 FQL 查询,用于检索链接的点赞数或评论数

 select url, like_count from link_stat where url="https://ballentines.herokuapp.com/?name=charlatan"

我已经用 Graph Explorer 调试了上面的查询

引用:https://developers.facebook.com/tools/explorer/145634995501895/?fql=SELECT%20like_count%20FROM%20link_stat%20WHERE%20url%20%3D%20%27https%3A%2F%2Fballentines.herokuapp.com%2F%3Fname%3Dcharlatan%27

如果您检查上面的链接,您会得到正确的 like_count(现在是 3)。截图如下 enter image description here

如果您检查上面的屏幕截图,则选择的应用程序是“Graph API Explorer”,这是使用 Graph API Explorer 进行调试时的默认应用程序。

如果您使用正确的开发者帐户登录。应用程序下拉列表也会有您的应用程序。

所以切换到您的应用程序后,单击“获取应用程序 token ”,然后提交查询。现在 like_count 对于同一个查询会变成 0。请参阅下面的屏幕截图。

enter image description here

现在单击“获取访问 token ”,这将要求您允许该应用程序(如果您尚未这样做)。在“允许应用程序”之后,正确的用户访问 token 将加载到“访问 token ”框中,现在再次提交您的查询。现在“like_count”将按预期为 3。

enter image description here

因此,您需要适当的用户访问 token 才能从“link_stat”FQL 表中检索适当的信息,而 App 访问 token 不适用于它

希望这对您有所帮助。

关于ajax - 点赞按钮显示我的点赞数,但在 facebook api 中不可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23386942/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com