Skip to content

Interacting with google

ciaranj edited this page Oct 31, 2010 · 3 revisions
var sys= require('sys');
var OAuth= require('oauth').OAuth;

oa= new OAuth("https://www.google.com/accounts/OAuthGetRequestToken",
             "https://www.google.com/accounts/OAuthAuthorizeToken", 
             "anonymous",  "anonymous", 
             "1.0A", "http://localhost:3000/oauth/callback", "HMAC-SHA1");       

oa.getOAuthRequestToken({"scope":"http://www.google.com/calendar/feeds"},function(error, oauth_token, oauth_token_secret, results){
 if(error) sys.puts('error :' + JSON.stringify(error))
 else { 
   sys.puts('oauth_token: ' + oauth_token)
   sys.puts('oauth_token_secret: ' + oauth_token_secret)
   sys.puts('requestoken results: ' + sys.inspect(results))
   sys.puts("Requesting access token")
 }
}) 
Clone this wiki locally