Last active
October 2, 2015 11:27
-
-
Save knorthfield/2235853 to your computer and use it in GitHub Desktop.
Get latest Facebook status for business page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$token = file_get_contents( | |
'https://graph.facebook.com/oauth/access_token?client_id=APP_ID&client_secret=APP_SECRET&grant_type=client_credentials', | |
false, | |
stream_context_create( | |
array( 'http' => array('ignore_errors' => true) ) | |
) | |
); | |
$fb = json_decode( | |
file_get_contents( | |
'https://graph.facebook.com/smythsons/feed?'.$token, | |
false, | |
stream_context_create( | |
array( 'http' => array('ignore_errors' => true) ) | |
) | |
), | |
true | |
); | |
$latest_fb = $fb['data'][0]['description']; | |
echo $latest_fb; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment