Facebook Page - Latest Stories Posted?
Not sure if t开发者_如何学Gohis is possible. I want to grab the latest X stories posted to a facebook page wall and embed them into an external site - preferably with PHP. Something like the latest tweets but with a facebook page.
this is definitely possible using the PHP Facebook API client.
http://wiki.developers.facebook.com/index.php/Stream.get
To do this you will need an API key (obviously).
using the Client Library you'll just need to call:
$stream = $facebook->api_client->stream_get($viewer_id, $source_ids, $start_time, $end_time, $limit, $filter_key, $metadata);
foreach($stream as $wallpost)
{
echo '<pre>';
print_r($wallpost);
echo '</pre>';
}
where
$source_ids = the page
$limit = the limit of posts you want
$viewer_id = the id of the viewer, obviously someone with viewing permission of the wall.
You probably want to take a look at Facebook Connect.
精彩评论