Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (18 sloc) 611 Bytes
require('dotenv').load();
var Twitter = require('twitter');
var client = new Twitter({
consumer_key: process.env.TWITTER_CONSUMER_KEY,
consumer_secret: process.env.TWITTER_CONSUMER_SECRET,
access_token_key: process.env.TWITTER_ACCESS_TOKEN_KEY,
access_token_secret: process.env.TWITTER_ACCESS_TOKEN_SECRET,
});
var terms = process.argv.slice(2);
console.log("tracking terms: " + terms);
client.stream('statuses/filter', {track: terms[0]}, function(stream){
stream.on('data', function(tweet) {
console.log(tweet);
});
stream.on('error', function(error) {
console.log(error);
});
});