Archive for the ‘Twitter’ Category

Quick start: Twitter API

Monday, November 8th, 2010
  1. register and get keys and tokens for your app.
  2. download twitteroauth library from github. Copy twitteroauth folder to your working space.
  3. try this code

    <?php
    require_once("./twitteroauth/twitteroauth.php");
    $consumer_key=""; // copy your keys and tokens
    $consumer_secret="";
    $access_token="";
    $access_token_secret="";
    $obj = new TwitterOAuth($consumer_key, $consumer_secret, $access_token, $access_token_secret);
    $opt = array();
    $opt['status']="I AM A ROBOT";
    $obj->OAuthRequest("http://api.twitter.com/1/statuses/update.xml", "POST", $opt);
    ?>
Related Posts with Thumbnails