如何获取某个 URL 的总点赞数(点赞数和分享数)?

2023-12-07

我在页面上放置的“Likes”插件会显示直接单击按钮的次数,以及页面 URL 被共享或点赞被评论的次数。

不过,当我使用 Graph API 查看我的对象时,它只显示直接“点赞”点击的数量。这是一个示例对象:

{
   "id": "17678692xxxxxxx",
   "name": "The Dali Lama Returns",
   "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/161984_176786925772923_6855xxxxxxx.jpg",
   "link": "http://mysite.com/8/the-dali-lama-returns",
   "likes": 1,
   "app_id": 478xxxxxxx,
   "category": "Unknown",
   "is_published": true,
   "description": "The Dali Lama will speak, and we will listen.",
   "about": "The Dali Lama will speak, and we will listen.",
   "can_post": true
}

这意味着,在有人单击我的“喜欢”按钮并撰写有关“喜欢”的评论后,该按钮将显示计数“2”,但我的对象将仅显示计数“1”。

有没有办法获得按钮在我的页面上显示的完整“点赞”计数?


我找到了两种方法来做到这一点。利用图 api 的新方法似乎是使用 fql,如以下请求所示:

https://graph.facebook.com/fql?q=SELECT url, normalized_url, share_count, like_count, comment_count, total_count, commentsbox_count, comments_fbid, click_count FROM link_stat WHERE url='http://mysite.com/8/the-dali-lama-returns'

旧方法,使用 Rest API,该 API 正在被弃用:

link.getStats()

https://developers.facebook.com/docs/reference/rest/links.getStats/

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何获取某个 URL 的总点赞数(点赞数和分享数)? 的相关文章

随机推荐