Created
July 8, 2013 18:58
-
-
Save mattcdavis1/5951469 to your computer and use it in GitHub Desktop.
Get a facebook token and posts from a facebook 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 | |
$tokenUrl = 'https://graph.facebook.com/oauth/access_token?client_id={client_id}&client_secret={client_secret}&grant_type=client_credentials'; | |
$token = file_get_contents($tokenUrl); | |
$postsUrl = 'https://graph.facebook.com/{page_id or slug}/posts?' . $token; | |
$postsJson = file_get_contents($postsUrl); | |
$posts = json_decode($postsJson); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment