的Facebook图表API端点邮寄

的Facebook图表API端点邮寄

本文介绍了用于获取“喜欢,分享,评论”的Facebook图表API端点邮寄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Facebook计划在V2.0之后退出对FQL的支持

Facebook is planning to drop support for FQL after V2.0 https://developers.facebook.com/docs/apps/changelog/#v2_0_fql

可以使用FQL轻松完成以下任务

The below task could be done easily with FQL

SELECT like_info.like_count, comment_info.comment_count, share_count
FROM stream
WHERE post_id = "POST_ID_HERE"

我无法在图形API中找到上述方法的替代方法。我知道我们可以得到喜欢和评论,如

I am unable to find a replacement to the above method in graph api. I know we can get likes and comments count like

POST_ID/likes?summary=true AND
POST_ID/comments?summary=true

但我无法找到类似的共享端点。

but I am unable to find a similar endpoint for shares.

注意:我不是在寻找解决方案,而是为URL分享获取URL输入和查询图表API,而我正在寻找找到解决方案,以通过POST_ID获取股票数量

NOTE: I am not looking for solutions that take URL input and query graph api for that URL shares, rather I am looking at finding solution to get shares count by POST_ID

PAGE_ID/feed?fields=comments.limit(1).summary(true),likes.limit(1).summary(true)

我看过。



  1. 的Facebook Graph API



  1. Facebook API: best way to get like, share, comment count for a page/group post?
  2. How to get Likes Count when searching Facebook Graph API with search=xxx
  3. Facebook post comment count from Graph API
  4. http://www.quora.com/Facebook-Graph-API/Facebook-Graph-API-How-to-get-the-number-of-likes-on-a-status

结果应该是这样的:

{
  "data": [{
      "like_info": {
      "like_count": 3506
    },
      "comment_info": {
      "comment_count": 263
    },
      "share_count": 278
  }]
}

任何帮助都将非常感激。

Any help would be highly appreciated.

干杯!

更新:这是一个访问令牌问题,因为我使用的令牌没有read_stream的允许n。

UPDATE: It was an access token issue as the token I was using did not have "read_stream" permission.

推荐答案

字段分享不需要 .summary(true)结束。它总会带来总数。但是喜欢并且需要注释 .summary(true)

The field shares does not need the .summary(true) at the end. It will bring always the total. But the likes and comments does need .summary(true)

示例:

[POST_ID]?fields = shares,likes.summary(true),comments.summary(true)

这将带来股票总数,评论和喜欢。

This will bring the total count of shares, comments and likes.

您可能有一个具有 read_stream 权限的access_token以获取共享数。

You may have a access_token with an read_stream permission to get the shares count.

这篇关于用于获取“喜欢,分享,评论”的Facebook图表API端点邮寄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 20:56