我已经编写了一些 JavaScript 来获取 Facebook 页面上的所有帖子。我这样做的 URL 是这样的:
http://graph.facebook.com/cocacola/feed?limit=5&callback=facebookResponse
直到上周的某个时候,我才开始看到 oauth 错误,这工作得很好而且花花公子。
我在 Stack 上搜索了一个小时左右,看到很多其他人都在尝试这样做,但是在我对 FB 的所有请求开始返回这些 oauth 错误之后,没有人问过我。
这真的没有意义,- 我正在尝试从公司页面访问公开可用的数据。我仍然可以在没有 oauth 的情况下通过 RSS 这样做(尽管方式有限)。
无论如何,我希望有人能告诉我如何获得这些公开可用的信息,而不必经历获取应用程序 ID、授权 token 等繁琐的过程。
最佳答案
这是一个 recent not-so-recent change ,但您现在需要访问 token 才能访问 /feed
和 /posts
。很烦人,但至少可以导航。
编辑:更新了链接,该链接自这篇文章相关以来已经中断了很多年。以下是该帖子的相关文字,供后人引用:
Breaking change: Graph API
PROFILE_ID/feed
andPROFILE_ID/posts
requires access_tokenThe Graph API
PROFILE_ID/feed/
for a Page, Application, User or Group andPROFILE_ID/posts
for a Page or User will now require a vaild [sic] access_token to access the wall or posts of the corresponding object (where previously no access_token was required). This will also affect direct FQL queries to the stream table, when querying for posts on a wall.You will need to pass a valid app or user access_token to access this functionality. Please update your code if you are calling this API without an access token. This change will go live a week from today - Friday(June 3rd). We have updated the Roadmap to reflect this change.
Moving forward, you should always pass a valid app or user access_token with all API requests.
关于javascript - 获取 Facebook 页面帖子,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6528113/