Created
September 11, 2013 05:41
-
-
Save huseyinbabal/6519720 to your computer and use it in GitHub Desktop.
NodeJS Oauth
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
var OAuth = require('OAuth'); | |
var oauth = new OAuth.OAuth( | |
'https://api.twitter.com/oauth/request_token', | |
'https://api.twitter.com/oauth/access_token', | |
'your Twitter application consumer key', | |
'your Twitter application secret', | |
'1.0A', | |
null, | |
'HMAC-SHA1' | |
); | |
oauth.get( | |
'https://api.twitter.com/1.1/trends/place.json?id=23424977', | |
'your user token for this app', | |
//you can get it at dev.twitter.com for your own apps | |
'your user secret for this app', | |
//you can get it at dev.twitter.com for your own apps | |
function (e, data, res){ | |
if (e) console.error(e); | |
console.log(require('util').inspect(data)); | |
done(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment