Facebook Graph API 没有提供 2011 年之前的任何数据?

发布于 2024-12-27 03:22:42 字数 1131 浏览 2 评论 0 原文

我是Fazzle 应用。我的应用程序所做的基本上是下载用户状态更新并按各种顺序对它们进行排序(例如最喜欢的、最多评论的)。

我一直想知道 Facebook 是否允许开发者从加入 Facebook 之日起获取用户的状态更新,因为当我启动该应用程序时,我只能获取 2009 年以来的用户状态。今天我刚刚发现 Facebook 将 Graph API 调用限制为 2011 年以来 。

我尝试查看文档,在这里询问,并通过他们的论坛联系了 Facebook 然而到目前为止,Graph API 中还没有关于此限制的消息。我错过了什么吗?有没有其他方法可以获取 2011 年之前的状态更新数据?

您可以在此处自行测试。使用此 GET 请求:

https://graph.facebook.com/(your_user_id)/statuses?limit=99999

向下滚动,您会发现并非所有内容都已下载。

这是因为与 Facebook Timeline 存在利益冲突吗?如果是这样,那就糟了。

此处记录为错误。如果有错误的话,还是希望有人能指出我的错误。

I'm the author of Fazzle app on iPhone. What my app does is basically download user status updates and sort them in various orders (e.g. most liked, most commented).

I have been wondering if Facebook allow developers to get user's status updates since the day they joined Facebook, because when I launched the app I can only get user statuses from 2009. Today I just discovered that Facebook limits Graph API calls down to just since 2011.

I tried looking at documentations, asked around here, and contacted Facebook through their forum. However so far there is no word on this limitation in Graph API. Did I miss something? Is there any other way for me to get data for status updates earlier than 2011?

You can test it yourself here. Use this GET request:

https://graph.facebook.com/(your_user_id)/statuses?limit=99999

Scroll down and you'll find out that not everything's downloaded.

Is this because of conflict of interest with Facebook Timeline? If so, that sucks.

Logged as a bug here. Still hoping someone can point out my mistakes if there's any.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

策马西风 2025-01-03 03:22:42

当然,您可以从 Graph API 获取较旧的帖子;没有限制(至少我不知道)。使用 sinceuntil 参数回页浏览结果,而不是 offset

https://graph.facebook.com/me/feed?access_token=[token]&until=1165474447

分页的文档sinceuntil方面没有非常深入:

查询连接时,有几个有用的参数可让您过滤和分页连接数据:

但是基本上,until 就像是说“给我直到这个日期的帖子”,而since 也类似,“给我从这个日期开始的帖子”。因此,您可以使用类似这样的循环一直向后滚动用户的提要:

// pseudocode
timestamp = now
do {
  posts = graph.get(/me/feed?until=timestamp)
  if posts.length == 0: break;
  // process posts
  timestamp = posts[0].created_time // first should be the oldest, in theory
} while (1)

until 替换为 since,将最早的 created_time 替换为最新的 created_time及时前进,例如获取自用户上次运行应用程序以来的任何新帖子。

Absolutely you can get older posts from Graph API; there is no limit (at least not that I am aware of). Use the since and until parameters to page back through results, instead of offset:

https://graph.facebook.com/me/feed?access_token=[token]&until=1165474447

Documentation for Paging doesn't go very in-depth on since and until:

When querying connections, there are several useful parameters that enable you to filter and page through connection data:

But basically, until is like saying "Give me posts up until this date", and since is similar, "Give me posts since this date". So you can scroll all the way back through a user's feed using a loop something like this:

// pseudocode
timestamp = now
do {
  posts = graph.get(/me/feed?until=timestamp)
  if posts.length == 0: break;
  // process posts
  timestamp = posts[0].created_time // first should be the oldest, in theory
} while (1)

Replace until with since and oldest created_time with the newest to go forwards in time, e.g. to grab any newer posts since the last time the user ran the app.

生生漫 2025-01-03 03:22:42

Facebook 自此确认这是一个错误。如果您曾经关注过 Facebook 的错误跟踪器,那么不幸的是,这意味着他们实际上修复此问题的机会非常小。

Facebook has since confirmed this as a bug. If you have followed Facebook's bug tracker ever, unfortunately that means there is very little if any chance they will actually fix this.

莳間冲淡了誓言ζ 2025-01-03 03:22:42

您将需要分页。极限是有限的。请阅读http://developers.facebook.com/blog/post/478/

You will need to paginate. Limit is limited. Please read http://developers.facebook.com/blog/post/478/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文