I've been working on a script to post to various social networks. I'm a fairly strong programmer, but have never worked with OAuth or the Facebook graph api. So as the title says, i'm trying to write a script that will make a post onto a facebook event wall.
Here is the code i have so far
Code: Select all
require 'facebook-php-sdk/src/facebook.php';
$fb = new Facebook(array(
'appId' => '100164043386901',
'secret' => '74068d49e68012612e2440eea74f0301',
'cookie' => true,
));
$fb->api('/me/feed', 'POST', array(
'message' => 'This is a test post',
'picture' => '',
'link' => '',
'name' => '',
'caption' => '',
'description' => '',
'icon' => ''
));
https://graph.facebook.com/oauth/author ... client_id=[my id]&redirect_uri=[my uri]&scope=offline_access,publish_stream
So that is all good, i accept the permissions and it redirects back to my script with the access token in the url. And now i'm stuck. What do i do with the access token? How do i finish the authentication process?
Thank you in advance for any replies, i will be checking this all day to get as fast as a resolution as possible. If you need any info just ask!