-
-
Save vjnrv/418539 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get the TwitterOAuth source code: | |
* http://github.com/abraham/twitteroauth | |
* git clone git@github.com:abraham/twitteroauth.git | |
* | |
* Get your OAuth credentials: | |
* http://dev.twitter.com/pages/oauth_single_token | |
*/ | |
require_once('twitteroauth/twitteroauth.php'); | |
echo '<pre>'; | |
$connection = new TwitterOAuth('consumer key', 'consumer secret', 'access token', 'access token secret'); | |
$annotations = array('foo' => array('bar' => 'baz')); | |
$result = $connection->post('statuses/update', array( 'status' => 'Hello annotated world!', | |
'annotations' => json_encode($annotations))); | |
if (200 == $connection->http_code) { | |
echo 'Success! :)'; | |
} else { | |
echo 'Failure! :('; | |
} | |
echo '<br><br>'; | |
print_r($result); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment