I've been trying to get the most recent Facebook Status for a fan page via the API for a while now and can't seem to get what I'm after. I'm really trying to avoid using RSS for it. I can get the full list from the feed via https://graph.facebook.com/174690270761/feed but I want only the last status posted by the page admin, not by anyone else.
Is their an easy way to get it without having to authenticate?
Thanks in advance
edit: https://graph.facebook.com/174690270761/statuses seems to be what I'm looking for but I need an OAuthAccessToken for this but can't see how to without involving the user, as I'm trying to access through my own credentials/application
Facebook has changed the api and now requires you to provide an access token. You can use Facebooks PHP sdk for that but i found a much quicker way to go:
<?
$appid = '1234567890';
$secret = 'db19c5379c7d5b0c79c7f05dd46da66c';
$pageid = 'Google';
$token = file_get_contents('https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id='.$appid.'&client_secret='.$secret);
$feed = file_get_contents('https://graph.facebook.com/'.$pageid.'/feed&'.$token);
print_r(json_decode($feed));
?>
Update 15/12/12 app access tokens nosist of the id and secret now - use this request:
$feed = file_get_contents('https://graph.facebook.com/Saxity/feed?access_token='.$appid.'|'.$secret);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With