开发者

Facebook Page - Latest Stories Posted?

开发者 https://www.devze.com 2022-12-22 19:16 出处:网络
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 tw

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.

0

精彩评论

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