-
-
Save ciaranj/792011 to your computer and use it in GitHub Desktop.
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
With these changes everything seems to work just peachy-fine for me. Is your Application configured as a 'client' type rather than a browser type? (Client is correct for pin verification) |
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 fs = require('fs'); | |
OAuth = require('oauth').OAuth; | |
// Your Twitter Application type must be 'client' and not 'browser' for pin verification. | |
var oa = new OAuth("http://twitter.com/oauth/request_token" | |
, "http://twitter.com/oauth/access_token" | |
, config.consumerKey | |
, config.consumerSecret | |
, "1.0" | |
, null | |
, "HMAC-SHA1"); | |
var args= process.argv; | |
if( args.length < 3) { | |
oa.getOAuthRequestToken(function(err, oauth_token, oauth_token_secret, results){ | |
if(err) throw err; | |
// Now send the user to a browser with the address: | |
// console.error(arguments); | |
console.log("Please visit here:\n " + "http://twitter.com/oauth/authenticate?oauth_token="+ oauth_token) ; | |
console.log("When you have got your pin, please execute this command: ") | |
console.log(" " + args[0] +" "+ args[1] + " " + oauth_token + " " + oauth_token_secret + " <your_pin_number>") | |
}); | |
} else { | |
var token= args[2]; | |
var token_secret= args[3]; | |
var pin= args[4]; | |
oa.getOAuthAccessToken(token | |
, token_secret | |
, pin // authorize PIN goes here | |
, function(error, oauth_access_token, oauth_access_token_secret, results2) { | |
console.error(arguments); | |
}); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment