Created
July 6, 2013 14:09
-
-
Save chrisweb/5939997 to your computer and use it in GitHub Desktop.
https://github.com/jdub/node-twitter module configuration (options) to make the nodejs module compatible with the new twitter 1.1 rest and streaming API
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 TwitterModule = require('twitter'); | |
var util = require('util'); | |
twitterModuleConfiguration: { | |
// oauth | |
consumer_key: '000000000000000000000', | |
consumer_secret: '000000000000000000000000000000000000', | |
access_token_key: '0000000000000000000000000000000000', | |
access_token_secret: '00000000000000000000000000000000000', | |
// twitter api 1.1 | |
rest_base: 'https://api.twitter.com/1.1', | |
stream_base: 'https://stream.twitter.com/1.1', | |
search_base: 'https://api.twitter.com/1.1/search', | |
user_stream_base: 'https://userstream.twitter.com/1.1', | |
site_stream_base: 'https://sitestream.twitter.com/1.1' | |
} | |
var Twitter = new TwitterModule(twitterModuleConfiguration); | |
twit.search('nodejs OR #node', function(data) { | |
console.log(util.inspect(data)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You also need to edit twitter js and edit line 182: