使用字段参数查询FB Graph API feed? [英] Querying FB Graph API feed with fields parameter?

查看:87
本文介绍了使用字段参数查询FB Graph API feed?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当Facebook Facebook被Facebook Graph API添加了对象)

what happens when a Facebook page is queried for its feed with Facebook Graph API (JS SDK) and a URL parameter fields (like for the post object) is added?

我想从Feed只加载帖子id,分享,喜欢和评论,因为页面非常活跃,JSON中的文本数据2天约为2MB(25个项目)...

I would like to load from the feed only the posts id's, shares, likes and comments, because the page is pretty active and the text data in JSON for 2 days is about 2MB (25 items)...

我希望可以这样做: FB.api('/ SomePage?fields = id,shares,likes'),但是我想你可以访问的唯一字段是直接的子代(对于 feed ,即数据& 分页)?如果不幸的是这种情况,是否有任何其他方式可以从日期x到日期y检索所有帖子,而无需下载整个Feed?

I would hope one could do like this: FB.api('/SomePage?fields=id,shares,likes'), but I suppose the only fields you can access are the direct children (for feed, that is data & paging)? If this unfortunately is the case, is there any other way to retrieve all posts from date x to date y without downloading the entire feed?

推荐答案

这是不正确的。 feed edge基本上是一个Post对象的数组。您可以使用现场扩展以及时间分页,如下所示:

That's not correct. The feed edge is basically an array of Post objects. You can use the Field Expansion together with time pagination as follows:

GET /{page_id}/feed?fields=id,shares,likes.summary(true)&since={start_unix_timestamp}&until={end_unix_timestamp}

请参阅

  • https://developers.facebook.com/docs/graph-api/reference/v2.2/page/feed/#read
  • https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#fieldexpansion
  • https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#paging

这篇关于使用字段参数查询FB Graph API feed?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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