Created
February 3, 2011 12:13
-
-
Save ryu22e/809402 to your computer and use it in GitHub Desktop.
node.jsでTwitter 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
// Twitterモジュールをインストールする必要がある。 | |
var sys = require('sys'), | |
twitter = require('twitter'); | |
var twit = new twitter({ | |
consumer_key: '****', // CONSUMER_KEYを指定する。 | |
consumer_secret: '****', // CONSUMER_SECRETを指定する。 | |
// ACCESS_TOKEN_KEYとACCESS_TOKEN_SECRETの取得はhttps://gist.github.com/802917を参照。 | |
access_token_key: '****', // ACCESS_TOKEN_KEYを指定する。 | |
access_token_secret: '****' // ACCESS_TOKEN_SECRETを指定する。 | |
}); | |
twit.stream('user', function(stream) { | |
stream.on('data', function(data) { | |
console.log(data); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment