File: twitter-streaming/node_modules/ntwitter/node_modules/oauth/examples/term.ie.oauth-HMAC-SHA1.js

Recommend this page to a friend!
  Classes of Igor Escobar   Terminal Crossword   twitter-streaming/node_modules/ntwitter/node_modules/oauth/examples/term.ie.oauth-HMAC-SHA1.js   Download  
File: twitter-streaming/node_modules/ntwitter/node_modules/oauth/examples/term.ie.oauth-HMAC-SHA1.js
Role: Example script
Content type: text/plain
Description: Example script
Class: Terminal Crossword
Generate a crosswords board on a text console
Author: By
Last change:
Date: 2 years ago
Size: 1,307 bytes
 

Contents

Class file image Download
var util= require('util') var OAuth= require('../lib/oauth').OAuth; var oa= new OAuth("http://term.ie/oauth/example/request_token.php", "http://term.ie/oauth/example/access_token.php", "key", "secret", "1.0", null, "HMAC-SHA1") oa.getOAuthRequestToken(function(error, oauth_token, oauth_token_secret, results){ if(error) util.puts('error :' + error) else { util.puts('oauth_token :' + oauth_token) util.puts('oauth_token_secret :' + oauth_token_secret) util.puts('requestoken results :' + util.inspect(results)) util.puts("Requesting access token") oa.getOAuthAccessToken(oauth_token, oauth_token_secret, function(error, oauth_access_token, oauth_access_token_secret, results2) { util.puts('oauth_access_token :' + oauth_access_token) util.puts('oauth_token_secret :' + oauth_access_token_secret) util.puts('accesstoken results :' + util.inspect(results2)) util.puts("Requesting access token") var data= ""; oa.getProtectedResource("http://term.ie/oauth/example/echo_api.php?foo=bar&too=roo", "GET", oauth_access_token, oauth_access_token_secret, function (error, data, response) { util.puts(data); }); }); } })