Skip to content

Instantly share code, notes, and snippets.

@davidino
Created October 12, 2012 15:34
Show Gist options
  • Select an option

  • Save davidino/3879804 to your computer and use it in GitHub Desktop.

Select an option

Save davidino/3879804 to your computer and use it in GitHub Desktop.
facebook stream
<?php
require_once __DIR__ . '/../vendor/php-sdk/src/facebook.php';
/*
some code
*/
$facebook = new Facebook(array(
'appId' => $app['facebook.app_id'],
'secret' => $app['facebook.app_secret'],
));
/*
some code
*/
$params = array(
//'message' => 'Il tuo profilo è idoneo'."\n".'Ti abilitiamo all’entrata in Boost 190'."\n".'Vieni a ritirare il tuo pass.',
'link' => 'http://www.boost190.it/facebook',
'picture' => 'http://www.boost190.it/img/fb_reveal.jpg',
'name' => 'Accedi',
'description' => 'Il tuo profilo è idoneo. '."\n".'Ti abilitiamo all’entrata in Boost 190. '."\n".'Vieni a ritirare il tuo pass.',
);
/*
some code
*/
try{
$facebook->api("/$user_id/feed",'post',$params);
}catch(FacebookApiException $e){
echo "[EXCEPTION]\t" . $e->getMessage() . "\t$user_id\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment