Created
May 6, 2011 20:18
-
-
Save jashkenas/959708 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # /server.coffee | |
| ... | |
| {TwitterNode} = require 'twitter-node' | |
| # create our interface to the Twitter Streaming API | |
| twitter = new TwitterNode | |
| user: 'yourtwitterusername' | |
| password: 'yourtwitterpassword' | |
| track: ["why"] | |
| # tell our interface what to do when a tweet comes in | |
| twitter.addListener 'tweet', (tweet) -> | |
| # print it. | |
| console.log tweet.text | |
| # start it up. | |
| twitter.stream() |
This file contains hidden or 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
| # /server.coffee | |
| ... | |
| TwitterNode = require('twitter-node').TwitterNode | |
| # create our interface to the Twitter Streaming API | |
| twitter = new TwitterNode({ | |
| user: 'yourtwitterusername', | |
| password: 'yourtwitterpassword', | |
| track: ["why"] | |
| }) | |
| # tell our interface what to do when a tweet comes in | |
| twitter.addListener('tweet', (tweet) -> | |
| # print it. | |
| console.log(tweet.text) | |
| ) | |
| # start it up. | |
| twitter.stream() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment