使用Facebook Graph API 2.2获得喜欢和分享的数量 [英] Using Facebook Graph API 2.2 to get like and share count

查看:118
本文介绍了使用Facebook Graph API 2.2获得喜欢和分享的数量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从旧的FQL更新项目到图形API 2.2,我没有想法如何获得喜欢的特定链接,他们的文档对我来说不是很透明(我是初学者)。我相信它会像这样: https://graph.facebook.com/v2.2/?id= {myURL} / {某些字段like like_count} 但我不知道如何使用图形API来正确使用。我会感谢任何帮助。

解决方案

嗯,文档很清楚我想:





/?id = {url} 端点上没有像count一样!示例调用将是

  GET /?id=http://mashable.com/2015/02/17/10-分钟规则/ 

回应:

  {
og_object:{
id:664547577004455,
description:制作10分钟规则工作的三个提示
title:一个10分钟的计时器可以改变你的生产力,
type:article,
updated_time:2015-02- 17T13:55:11 + 0000,
url:http://mashable.com/2015/02/17/10-minute-rule/
},
分享:{
comment_count:0,
share_count:180
},
id:http://mashable.com/2015/02/ 17/10分钟规则/
}

如果您只想要共享数,使用

  GET /?fields=id,share&id=http://mashable.com/2015/02/17 / 10分钟规则/ 

回应:

  {
id:http://mashable.com/2015/0 2/17/10分钟规则/,
share:{
comment_count:0,
share_count:180
}
}


I'm working on updating project from old FQL to graph api 2.2 and i dont have idea how to get likes count on specific link, their documentation is not very transparent for me(i'm beginer). I believe it shoud be something like this: https://graph.facebook.com/v2.2/?id={myURL}/{some fields like like_count} but i have no clue how to do it right using graph API. I will appreciate any help.

解决方案

Well, the docs are quite clear I think:

There is NO like count on the /?id={url} endpoint! A sample call would be

GET /?id=http://mashable.com/2015/02/17/10-minute-rule/

Response:

{
  "og_object": {
    "id": "664547577004455", 
    "description": "Three tips for making the 10-minute rule work for you.", 
    "title": "A 10-minute timer could revolutionize your productivity", 
    "type": "article", 
    "updated_time": "2015-02-17T13:55:11+0000", 
    "url": "http://mashable.com/2015/02/17/10-minute-rule/"
  }, 
  "share": {
    "comment_count": 0, 
    "share_count": 180
  }, 
  "id": "http://mashable.com/2015/02/17/10-minute-rule/"
}

If you just want the share count, use

GET /?fields=id,share&id=http://mashable.com/2015/02/17/10-minute-rule/

Response:

{
  "id": "http://mashable.com/2015/02/17/10-minute-rule/", 
  "share": {
    "comment_count": 0, 
    "share_count": 180
  }
}

这篇关于使用Facebook Graph API 2.2获得喜欢和分享的数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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