繁体   English   中英

[Facebook][Graph-API] Facebook 不会返回页面的所有帖子

[英][Facebook][Graph-API] Facebook doesn't return all posts for a page

我目前正在测试从特定时间范围内的媒体页面获取一些帖子:

  • 页面: https : //www.facebook.com/LExpress
  • 自: 2017-09-06 11:00:00 +0000 (strtotime -> 1504688400)
  • 直到: 2017-09-06 18:00:00 +0000 (strtotime -> 1504713600)

但令人惊讶的是,Facebook 的回复中缺少一些帖子。

这是用于获取帖子列表的 Facebook 请求:

https://developers.facebook.com/tools/explorer?method=GET&path=LExpress%2Fposts%3Fsince%3D1504688400%26until%3D1504713600&version=v2.11

这仅返回以下三个结果:

 "data": [
        {
          "created_time": "2017-09-06T15:05:00+0000",
          "message": "Casernes de pompiers inondées, hôtels dévastés : l'ouragan Irma s'est abattu sur les îles de Saint-Barthélemy et Saint-Martin",
          "id": "9359316996_10155287552551997"
        },
        {
          "created_time": "2017-09-06T14:15:00+0000",
          "message": "Le gouvernement aussi a fait sa rentrée des classes",
          "id": "9359316996_10155287360111997"
        },
        {
          "created_time": "2017-09-06T09:45:00+0000",
          "message": "Persécutés, des dizaines de milliers de Rohingyas fuient la Birmanie",
          "id": "9359316996_10155286897911997"
        }
      ]

但是2017-09-06 12:56:32 发表的帖子在哪里??

以下帖子已于2017-09-06 12:56:32 +0000 发布,应在指定日期范围内由 Facebook 返回:

  • 自: 2017-09-06 11:00:00 +0000
  • 直到: 2017-09-06 18:00:00 +0000

https://developers.facebook.com/tools/explorer?method=GET&path=10155287271171997%3Ffields%3Did%2Cupdated_time%2Ccreated_time%2Cname&version=v2.11

{
  "id": "10155287271171997",
  "updated_time": "2017-09-06T12:56:32+0000",
  "created_time": "2017-09-06T12:56:32+0000",
  "name": "⭕ ALERTE — Ouragan Irma : black-out total sur les îles de Saint-Barthélémy et Saint-Martin

Centrales EDF hors-service, casernes de pompiers inondées

Suivez notre direct"
}

为什么? 有什么想法吗?

谢谢!

PS:因为它是photos我也尝试从 /photos 路线获取它,但我们没有得到任何结果......

答案是 Facebook 将每页最多返回 600 个帖子,如页面的提要limitations段落中所述:

API 每年最多会返回 600 个已排名、已发布的帖子。

https://developers.facebook.com/docs/graph-api/reference/v2.11/page/feed#read

就像 Ben Tazulev 所说的那样, /{page-id}/posts端点有一个限制:

API 每年将返回大约 600 个已排名、已发布的帖子。 对于所有帖子,请查询/{page_id}/published_posts端点。

-> https://developers.facebook.com/docs/graph-api/reference/v2.11/page/feed#read

但是,当我尝试使用/{page_id}/published_posts收集所有帖子时,它起作用了!

-> https://developers.facebook.com/docs/graph-api/reference/page/published_posts/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM