Skip to content

Instantly share code, notes, and snippets.

@rmoura-92
Created May 2, 2013 22:51
Show Gist options
  • Save rmoura-92/5506072 to your computer and use it in GitHub Desktop.
Save rmoura-92/5506072 to your computer and use it in GitHub Desktop.
fb_post2wall
require 'src/facebook.php';
$facebook = new Facebook(array(
'appId' => 'app_ip',
'secret' => 'app_secret_id',
));
$message = 'hello world';
$user = $facebook->getUser();
$token = $facebook->getAccessToken();
$post = array('access_token' => $token, 'message' => $message);
try {
$res = $facebook->api('/appidareyou/feed','POST',$post);
print_r($res);
} catch (Exception $e){
echo $e->getMessage();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment