Getting Facebook Page Posts

末鹿安然 提交于 2020-02-20 05:43:18

问题


I've written a bit of JavaScript that will fetch all of the posts on a Facebook Page. The URL with which I do that is this:

http://graph.facebook.com/cocacola/feed?limit=5&callback=facebookResponse

and this worked fine and dandy, right up until last week sometime, when I started seeing oauth errors.

I've searched for an hour or so on Stack, and seen plenty of other people are trying to do this, - but none have been asked after all of my requests to FB started returning these oauth errors.

It really doesn't make sense, - I'm trying to access publicly available data from company pages. I can still do so without oauth (albeit in a limited fashion) via RSS.

Anyhow, I'm hoping someone can clue me in as to how to get this PUBLICLY AVAILABLE information without having to go through the rigmarole of getting an application ID, an authorization token, etc.


回答1:


This is a recent not-so-recent change, but you now need an access token to access /feed and /posts. Annoying, but at least it's navigable.

Edit: updated the link, which has broken in the many years since this post was relevant. Here's the relevant text from that post for future posterity:

Breaking change: Graph API PROFILE_ID/feed and PROFILE_ID/posts requires access_token

The Graph API PROFILE_ID/feed/ for a Page, Application, User or Group and PROFILE_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.



来源:https://stackoverflow.com/questions/6528113/getting-facebook-page-posts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!