Skip to content

Instantly share code, notes, and snippets.

@mostlyfine
Last active August 29, 2015 14:17
Show Gist options
  • Select an option

  • Save mostlyfine/330b71630d47263fd03b to your computer and use it in GitHub Desktop.

Select an option

Save mostlyfine/330b71630d47263fd03b to your computer and use it in GitHub Desktop.
usage) coffee twitterstream.coffee #cat
twitter = require 'twitter'
client = new twitter(
consumer_key: 'xxx'
consumer_secret: 'xxx'
access_token_key: 'xxx'
access_token_secret: 'xxx'
)
option = track: process.argv[2]
client.stream('statuses/filter', option , (stream) ->
stream.on('data', (tweet) ->
console.log("#{tweet.user.name} : #{tweet.text}")
)
stream.on('error', (error) -> throw error)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment