Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I made my own Twitter OAuth library. It still uses OAuth but the library is very small.</p> <p>Also, you still need to register an app for it and get the access token.</p> <p>If you want to check it out, here is it: <a href="http://blog.dt.in.th/2010/09/oauth-damnit/" rel="nofollow">I Just Want to Call Twitter’s API With My Own Account!</a></p> <p>Basically you need the <strong>consumer key</strong>, the <strong>consumer secret</strong>, the <strong>access token</strong> and the <strong>access token secret</strong>, so you have to register your application at [dev.twitter.com] (http://dev.twitter.com/) <strong>using the user you want to authenticate</strong>, then you will get the first 2. On the same page, click on "My Access Token" and you will get the last 2.</p> <p>Then you can:</p> <pre><code>$api = new OAuthDamnit(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET); echo $api-&gt;get('http://api.twitter.com/1/statuses/home_timeline.json', array()); </code></pre> <hr> <p>There are other alternatives such as using <a href="http://php.net/manual/en/book.oauth.php" rel="nofollow">PHP's OAuth Extension</a> which I think might be faster, but is is also very simple to use.</p> <pre><code>$oauth = new OAuth(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_AUTHORIZATION); $oauth-&gt;setToken(ACCESS_TOKEN, ACCESS_TOKEN_SECRET); $oauth-&gt;fetch('http://api.twitter.com/1/statuses/home_timeline.json'); echo $oauth-&gt;getLastResponse(); </code></pre> <hr> <p>Or if you don't want to use OAuth at all, you have <a href="http://simpleauthtwitter.heroku.com/" rel="nofollow"><strong>Simple Auth Twitter</strong></a> which can act like a basic auth gateway.</p> <p>You just have to sign it there and it will give you an <strong>API key</strong>. You use that as your Twitter password and use <code>http://simpleauthtwitter.heroku.com/api/</code> as the API endpoint.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload