Skip to content

Instantly share code, notes, and snippets.

Created April 24, 2014 08:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/11245942 to your computer and use it in GitHub Desktop.
Save anonymous/11245942 to your computer and use it in GitHub Desktop.
<?php
$the_tweet = 'hello';
// TWITTER API ==================
$consumerKey = 'qu...xF';
$consumerSecret = 'it...hG';
$oAuthToken = '24...ub';
$oAuthSecret = 'oy...d2';
include "OAuth.php";
include "twitteroauth.php";
$tweet = new TwitterOAuth($consumerKey, $consumerSecret, $oAuthToken, $oAuthSecret);
if (isset($the_tweet)) {
$tweetmsg = $the_tweet;
$tweet->post('statuses/update',array('status' => $tweetmsg));
echo "Your message has been sent to Twitter.";
} else {
echo "Your message has not been sent to Twitter.";
}
// END TWITTER API ==================
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment