-
-
Save Ilgrim/11b24b9fb163552911c92306e9dab8e2 to your computer and use it in GitHub Desktop.
Getting the most recent posts from a Public Page .
This file contains 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 | |
/* | |
This may be a long way around a short problem .. but | |
The PHP SDK from Facebook : | |
git clone https://github.com/facebook/php-graph-sdk.git | |
Im using my own FB App to give me a Token/Secret | |
/* | |
require_once '<path to git clone https://github.com/facebook/php-graph-sdk.git >/php-graph-sdk/src/Facebook/autoload.php'; | |
$APPID="1234567890987532"; | |
$APPSECRET="abcdefghij123453212sd"; | |
$PAGEID="pagenamefromurl"; | |
$fb = new Facebook\Facebook([ | |
'app_id' => $APPID, | |
'app_secret' => $APPSECRET, | |
]); | |
$fb->setDefaultAccessToken($fb->getApp()->getAccessToken()); | |
$request = $fb->get('/'. $PAGEID . "/posts?limt=5"); | |
echo print_r($request); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment