Skip to content

Instantly share code, notes, and snippets.

@huseyinbabal
Created September 11, 2013 05:41
Show Gist options
  • Save huseyinbabal/6519720 to your computer and use it in GitHub Desktop.
Save huseyinbabal/6519720 to your computer and use it in GitHub Desktop.
NodeJS Oauth
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