如何获得总计像从Facebook的一个帖子与Graph Api? [英] how can i get Total like From A post in Facebook with Graph Api?

查看:86
本文介绍了如何获得总计像从Facebook的一个帖子与Graph Api?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获得总计喜欢图表api url的帖子?

how to get total likes a post from graph api url ?

这里此链接

返回:
包含id和名称的对象数组领域。请求摘要= 1还将返回一个包含total_count的喜欢的摘要对象。

推荐答案

href =https://developers.facebook.com/tools/explorer/ =noreferrer> FB API资源管理器尝试抓取喜欢的帖子,我用700182169998352

in the FB API explorer try fetching likes for a post, i used 700182169998352

/ 700182169998352 / likes返回:

the "/700182169998352/likes" return:

{
  "data": [
    {
      "id": "663945278",
      "name": "Irene Olsson Wikler"
    },
    {
      "id": "100002437916716",
      "name": "Frida Braxell"
    },
    {
      "id": "1135121633",
      "name": "Rex Leopold Olsson"
    }
  ],
  "paging": {
    "cursors": {
      "after": "MTEzNTEyMTYzMw==",
      "before": "NjYzOTQ1Mjc4"
    }
  }
}

/ 700182169998352 / likes?summary = 1return:

the "/700182169998352/likes?summary=1" return:

{
  "data": [
    {
      "id": "663945278",
      "name": "Irene Olsson Wikler"
    },
    {
      "id": "100002437916716",
      "name": "Frida Braxell"
    },
    {
      "id": "1135121633",
      "name": "Rex Leopold Olsson"
    }
  ],
  "paging": {
    "cursors": {
      "after": "MTEzNTEyMTYzMw==",
      "before": "NjYzOTQ1Mjc4"
    }
  },
  "summary": {
    "total_count": 3
  }
}

所以通过添加?summary = 1 你可以在json结果中获得额外的部分,名为summary,
并包含total_count,在我的情况下3

so by adding the ?summary=1 you get an extra part in the json result named summary, and containng the total_count, in my case 3

这篇关于如何获得总计像从Facebook的一个帖子与Graph Api?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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