您如何获得网址的总喜好(喜欢和分享)? [英] How do you get the total likes for a URL (Likes and Shares)?

查看:85
本文介绍了您如何获得网址的总喜好(喜欢和分享)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网页上放下的喜欢插件显示了按钮已被直接点击的次数,以及页面网址已被共享的次数或已注释的次数。

The "Likes" plugin that I've dropped on my page displays both the number of times the button has been directly clicked, as well as the number of times the page URL has been shared or the Like has been commented on.

当我使用Graph API查看我的对象时,它只显示直接Like点击次数。以下是一个示例对象:

When I use the Graph API to check out my object though, it only shows the number of direct "Like" clicks. Here is an example object:

{
   "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的计数,但是我的对象只会显示一个计数。

This means that after someone has clicked my like button, and written a comment about the like, the the button will display a count of "2", but my object will only display a count of one.

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

推荐答案

我发现了两种做法是。使用图形API的新方法似乎是使用fql,如下面的请求所示:

I found two ways of doing this. The new way utilizing the graph api appears to be to be to use fql, as the following request shows:

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正在被弃用: p>

The old way, with the Rest API which is in the process of being deprecated:

link.getStats()

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

这篇关于您如何获得网址的总喜好(喜欢和分享)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆