daily pastebin goal
61%
SHARE
TWEET

Twitter API PHP

a guest Oct 21st, 2011 2,044 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?
  2.  
  3. $consumerKey    = ' ';
  4. $consumerSecret = ' ';
  5. $oAuthToken     = ' ';
  6. $oAuthSecret     = ' ';
  7.  
  8. include "OAuth.php";
  9. include "twitteroauth.php";
  10.  
  11. $tweet = new TwitterOAuth($consumerKey, $consumerSecret, $oAuthToken, $oAuthSecret);
  12.  
  13. if (isset($_GET['msg'])) {
  14.     $tweetmsg = $_GET['msg'];
  15.     $tweet->post('statuses/update',array('status' => $tweetmsg));
  16.     echo "Your message has been sent to Twitter.";
  17. } else {
  18.     echo "Your message has not been sent to Twitter.";
  19. }
  20.  
  21. ?>
  22.  
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