tags:

views:

64

answers:

2

Not sure if this 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.

A: 

You probably want to take a look at Facebook Connect.

terru
+1  A: 

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.

Jayrox
This seems to be what I am looking for. I havent defined $facebook, is the php library supposed to do this? I'm getting that error
Wes
Figured it out, had to put my facebook api key and secret key into the inline file.thanks!
Wes
Sorry, was behind a restrictive firewall at work. Darn thing keeps me from going into facebook's api docs. Glad you figured it out though :)
Jayrox

related questions