Just had a check through my code, and it should work just fine. I've
placed an example working solution inline to this response :)
var http = require('http')
, OAuth= require('./index').OAuth
, url = require('url')
, consumerKey= "YOUR_KEY"
, consumerSecret= "YOUR_SECRET"
, callbackURL= "YOUR_CALLBACK;
var oAuth= new OAuth("http://twitter.com/oauth/request_token",
"http://twitter.com/oauth/access_token",
consumerKey, consumerSecret,
"1.0a", callbackURL, "HMAC-SHA1");
http.createServer(function (req, res) {
var urlp= url.parse(req.url, true);
if( urlp.query && urlp.query.oauth_verifier ) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Verification callback: ' + urlp.query.oauth_verifier +'\n');
}
else {
oAuth.getOAuthRequestToken(function(error, oauth_token,
oauth_token_secret, oauth_authorize_url, additionalParameters ) {
console.log( error );
res.writeHead(301, {
'Location':
"http://twitter.com/oauth/authenticate?oauth_token=" + oauth_token
});
res.end();
});
}
}).listen(80, "127.0.0.1");
Hope this helps :)
- Cj.
--
Have you visited the Developer Discussions feature on https://dev.twitter.com/discussions yet?
Twitter developer links:
Documentation and resources: https://dev.twitter.com/docs
API updates via Twitter: https://twitter.com/twitterapi
Unsubscribe or change your group membership settings: http://groups.google.com/group/twitter-development-talk/subscribe