Advertisement
thieuthuy1997

code ml

Nov 9th, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <?
  2. // Include facebook class (make sure your path is correct)
  3. require_once("path/to/facebooksdk/src/facebook.php");
  4.  
  5. // Create our Application instance (replace this with your appId and secret).
  6.  
  7. $facebook = new Facebook(array(
  8. 'appId' => 'app_id',
  9. 'secret' => 'app_secret',
  10. 'cookie' => true,
  11. ));
  12.  
  13. //$token is the access token from the URL above
  14.  
  15. $post = array('access_token' => $token, 'message' =>'any message','name' => 'name','description'=> 'description','picture' => imageurl,'link'=>'http://yourlink','caption' =>'caption');
  16. try{
  17. $res = $this->tasks->api('/me/feed','POST',$post);
  18. } catch (Exception $e){
  19. echo $e->getMessage();
  20. }
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement