Official Facebook RSS feed for a Page

2020-02-23 09:30发布

问题:

Many people have described how to obtain the RSS data feed for a Facebook page.
For example: http://ahrengot.com/tutorials/facebook-rss-feed/

The following URL provides the feed for Coca-Cola's page:
http://www.facebook.com/feeds/page.php?format=rss20&id=40796308305

However, I cannot seem to find any documentation on facebook.com that describes this interface. Does anyone know if this interface is officially supported by Facebook? I don't want to reference it in my code only to have it dropped unexpectedly by Facebook.

I know I could use the Graph API 'posts' method of the 'page' object to obtain similar data, but that requires SSL and an access token, which I would like to avoid if possible.

回答1:

Facebook have changed its implementation to get facebook page RSS Feed

Following steps to get Facebook RSS Feed

  • Create facebook App link

  • From the above App you will get client_id and client_secret and then call this url

    https://graph.facebook.com/oauth/access_token?client_id=client_id_value&client_secret=client_secret_value&grant_type=client_credentials

    Replace client_id_value and client_secret_value with its actual value

  • From the above url, you will get assess token, Pass this token in below url to get page RSS Feed

    https://graph.facebook.com/v2.2/1242433444/feed?access_token=access_token_value

here 1242433444 is facebook page id



回答2:

Seems like Facebook prefers JSON over RSS. They support both formats to date, but JSON will likely outlive RSS. I've created some code samples for how to parse the JSON feed with PHP if you're interested:

http://liljosh.com/facebook-page-json-rss-feed/

No access token is required if the page is published (step one in the link above).



回答3:

You shouldn't rely on the RSS feed feature.

Your best approach for machine readable data is to query the statuses connection, eg https://graph.facebook.com/facebook/statuses?access_token=<ACCESS_TOKEN>.

You can then parse the JSON and output it as RSS.



标签: facebook rss