【问题标题】:Facebook API : get page feed with image, text and dateFacebook API:获取带有图像、文本和日期的页面提要
【发布时间】:2016-03-18 09:32:38
【问题描述】:

我目前能够使用这种类型的请求(使用 PHP)获取 FB 页面提要:

https://graph.facebook.com/{$id}/feed?{$authentication}&limit={$maximum}

它为我提供了来自 FB 页面的最新帖子,以及消息和发布日期。我只想检索此内容+每个帖子图片(如果至少有一个)。

所以我做了这个请求:

https://graph.facebook.com/{$feed}/feed?{$authentication}&fields=attachments&limit={$maximum}

检索内容(文本)+图片。但是里面没有日期...

检索包含内容文本、图像和发布日期的页面提要的最佳方式是什么?

【问题讨论】:

  • 只需将您想要的日期字段添加到fields参数...
  • 包含created_time 字段应该会为您获取帖子本身的日期/时间戳,例如feed?fields=attachments,created_time - 这就是你所缺少的吗?
  • 这是我遗漏的......我不知道我可以把我想要的所有东西都放在字段中(我最终得到了 fields=attachments,created_time,message)。我在 FB API 文档中查找,找不到。非常感谢。
  • “我在 FB API 文档中查找过,找不到。”developers.facebook.com/docs/graph-api/using-graph-api/#fields

标签: php facebook-graph-api


【解决方案1】:

包括 created_time 字段以获取除了其文本内容 (message) 和任何 attachments 之外的帖子时间戳:

通用请求示例:

https://graph.facebook.com/(api_version)/(page_id)?fields=feed{created_time,attachments,message}&access_token=(token_id)

输出中的示例时间戳:

"created_time": "2016-03-17T11:33:59+0000"

【讨论】:

    【解决方案2】:

    试试这些字段:

    https://graph.facebook.com/{$feed}/feed?{$authentication}&fields=created_time,from,link,message,picture,type,attachments,source&limit={$maximum}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-08
      • 1970-01-01
      • 2011-11-20
      相关资源
      最近更新 更多