SHARE
TWEET

Untitled

a guest Sep 28th, 2009 118 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/php
  2. <?php
  3. // IMPORTANT! READ THE FOLLOWING NOTES:
  4. //
  5. // This is a VERY stripped version of FBCMD by Dave Tomkins
  6. // It will NOT work unless you properly install his application
  7. // His application's homepage is http://fbcmd.dtompkins.com/
  8. //
  9. // The .libfb.php file is a merged version of all the Facebook API files
  10. // It can be downloaded at http://pastebin.com/f316e87b7
  11. //
  12. // This is just a heavily stripped down version of FBCMD
  13. // I did not really write this code -- just modified someone else's
  14.  
  15. include_once('.libfb.php');
  16.  
  17. $fbCmdVersion = '0.96';
  18. $GLOBALS['facebook_config']['debug']=false;
  19. $fbCmdAppKey = 'd96ea311638cf65f04b33c87eacf371e';    // FBCMD's app key (don't touch)
  20. $fbCmdAppSecret = '88af69b7ab8d437bff783328781be79b'; // FBCMD's secret (don't touch)
  21. $fbCmdUserSessionKey = '';  // sessionskey.txt Line 1 (use FBCMD with AUTH command to generate)
  22. $fbCmdUserSecretKey = ''; // sessionskey.txt Line 2 (ditto)
  23.  
  24. try {
  25.         $fbObject = new FacebookDesktop($fbCmdAppKey, $fbCmdAppSecret);
  26.         $fbObject->api_client->session_key = $fbCmdUserSessionKey;
  27.         $fbObject->secret = $fbCmdUserSecretKey;
  28.         $fbObject->api_client->secret = $fbCmdUserSecretKey;
  29.         $fbUser = $fbObject->api_client->call_method('facebook.users.getLoggedInUser', array());
  30. } catch (Exception $e) {
  31.         FbCmdException('Could not use session key / log in user',$e);
  32. }
  33. try { $fbObject->api_client->call_method('facebook.users.setStatus',array('status' => $argv[1],'status_includes_verb' => true)); }
  34. catch(Exception $e) {
  35.         if ($e->getCode() == 250) { FbCmdFatalError("STATUS requires special permissions:\n\nvisit the website:\n\nhttp://www.facebook.com/authorize.php?api_key={$fbCmdAppKey}&v=1.0&ext_perm=status_update\n\nor http://tinyurl.com/fbcmd-status\n\nto grant permissions\n"); }
  36.         else { FbCmdException('STATUS',$e); }
  37. }
  38. function FbCmdFatalError($err) { global $fbCmdVersion; die("\nfbcmd [v{$fbCmdVersion}] ERROR: {$err}\n"); }
  39. function FbCmdException($cmd,Exception $e) { FbCmdFatalError("{$cmd}\n[{$e->getCode()}] {$e->getMessage()}"); }
  40. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top