Created
March 4, 2012 18:58
-
-
Save akoenig/1974360 to your computer and use it in GitHub Desktop.
node.js talk - twitter stream reader
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
{ | |
"author": "Malte Legenhausen ([email protected]), John Philip Schnake ([email protected]), André König ([email protected])", | |
"name": "twitter-streamer", | |
"description": "A little app which receives tweets in realtime!", | |
"version": "0.0.1", | |
"homepage": "http://bremen.gtugs.com", | |
"repository": { | |
"url": "" | |
}, | |
"engines": { | |
"node": "~0.6.9" | |
}, | |
"dependencies": { | |
"ntwitter": "0.2.x" | |
}, | |
"devDependencies": {}, | |
"optionalDependencies": {} | |
} |
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
/* | |
* A little app which receives tweets in realtime! | |
* | |
* Author: André König ([email protected]) | |
* | |
*/ | |
"use strict"; | |
var Twitter = require('ntwitter'); | |
var twitter = new Twitter({ | |
consumer_key: 'Place your consumer key here.', | |
consumer_secret: 'Place your consumer secret here.', | |
access_token_key: 'Place your access token here.', | |
access_token_secret: 'Place your access token secret here.' | |
}); | |
twitter.stream('statuses/sample', function(stream) { | |
stream.on('data', function (data) { | |
var user = data.user.screen_name; | |
var tweet = data.text; | |
console.log('@' + user + ': ' + tweet); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment