开发者

Get Facebook Page Wall Stream

I want to get the posts (only from the band, not others) from a Facebook Page Wall (its a Band, so no private profile) and publish it on MY own 开发者_高级运维site.

I hoped to get the Posts as XML or JSON and then parse them. So I wanted to use Facebook as a news System.

But I didn't find a solution - I don't want to have the user to log in with his account to see anything - it should be just a public stream.

The only idea I found was to use twitter as an export mechanism, but that's kind of elaborate.

Does anybody have an idea?


You could use the Facebook php sdk: https://github.com/facebook/facebook-php-sdk It ends up looking like this:

//
include('facebook.php');
$fb_config = array(
        'appId'  => $yourAppId,
        'secret' => $yourSecret,
);
$facebook = new Facebook($fb_config);
$feed = $facebook->api("/{$nameOfFaceBookPage}/feed");

That will give you an array of feed stories.


I assume you created a facebook page for your band and it has url in such format:

http://www.facebook.com/pages/<band_name>/<page_id>

In this case you can read wall posts in json format using Graph API (no login required):

https://graph.facebook.com/<page_id>/feed


If you only want posts from "me", can't you just use the Like Box social plugin and show the stream? This plugin will only show posts from the page owner.

http://developers.facebook.com/docs/reference/plugins/like-box


I am developing a similar app and after a lot of searching finally accomplished

https://graph.facebook.com/194466683916784/feed?access_token=AAACTzPZAxblQBAHND7fo1rA58VqQawuJb806Q6BeIFhTroyGSYIe5i0R5fZAZBtffNvkkZB7ayvV7Vw7j7ZBf7vGt6xHx2gjx4FhO8d27sAZDZD

enter your page wall id after .com and in the access token get your own access token from Graph - API explorer

Then exchange that token for a longer for a longer lived one that is for 60 days and you are good to go


Some time ago I had your same problem and I was looking for something very simple to publish feeds of facebook pages, but I didn’t find any solution on the web.

What I want to achieve are the post (only from my personal fan page, not the other) of the bulletin board (facebook wall) of a FB page (this is a fan page, not private profiles) and publish it on my site.

I was hoping to get the posts in JSON or XML format and then encode them so as to use FB as a news system. Unfortunately I haven’t found any kind of solution because I don’t want the user has to log in his account to see something so it must be a flow of pubblic feed.

So, I decided to code the plugin. Here the link to the tutorial: http://www.lorenzodedonato.com/freebies/facebook-plugin-per-visualizzare-i-post-della-bacheca-di-una-pagina-fan-creato-in-php-json/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜