php - 使用 facebook graph api 选择特定字段

标签 php json facebook facebook-graph-api

我想通过图形 API 从用户 facebook 新闻源获取状态。

当我拥有正确的访问 token 时,这似乎非常简单,然后我可以使用 http://graph.facebook.com/home... 获取此数据,但我想获取仅状态;没有链接、照片、视频等..

在文档页面上,我看到了许多指定选定数据的可能性,例如我可以限制获得的帖子数量。是否有可能控制哪些数据将被特别获取,哪些不被获取?例如 graph.facebook.com/home?type="status"..

我可以在我的 PHP 脚本中对其进行分类,但随后我需要能够获取更多帖子,例如当我单击 facebook 或 twitter 上的“更多”按钮等时。我在 Facebook JSON 中看到一些分页数据(我希望它是 JSON:)),但我可能无法以正确的方式使用它..

感谢您的帮助!!

最佳答案

文档页面 http://developers.facebook.com/docs/api说:

The Graph API allows you to read properties and connections of the Facebook social graph. You can use the API to read specific fields, get pictures of any object, introspect an object for metadata and get real-time updates on any changes.

...还有...

You can choose the fields (or connections) you want returned with the "fields" query parameter. For example, this URL will only return the id, name, and picture of Ben: https://graph.facebook.com/bgolub?fields=id,name,picture

关于php - 使用 facebook graph api 选择特定字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4512041/

相关文章:

python - 应用了 base64 解码的数据在 json.loads() 中出错

c# - 尝试验证和阅读新闻源/时间线(C# 桌面应用程序)

c# - 如何在 .Net Core API 中验证 Facebook JWT

android - Android 中通过 Facebook API 上传本地文件

php - 使用 php 更新现有的 mysql 记录

javascript - DNI 根据登陆页面显示 div,在整个 session 中继续显示 div

php - laravel 循环中的多个 where 子句

javascript - CrossRider - 有没有办法将数组作为函数参数传递而不将它们转换为对象?

php - DVWA 1.9 设置错误

javascript - Lodash 转换对象和字符串的数组混合