A Twitter Stream Tracker tracking total word count and top words used (stop words filtered) in Twitter tweet stream using the Twitter Stream API via the tweetstream gem.
Must use Ruby v1.9.3, a tweetstream gemspec dependency.
rvm install ruby 1.9.3 (or install Ruby 1.9.3)
gem install tweetstream
Stop words, execution time limit and tweetstream gem Twitter credentials are configurable in the config.rb file.
Append stop words to filter words from tweet, removing them from top words counting.
STOP_WORDS = %w(and the me a or but is to of this that from in for on at - la y en de que I you my el your it with & & e o te The be so los para like I'm do se)
Set program to terminate in X number of seconds.
TERM_IN_SECONDS = 300
Create a Twitter App, then use the given app credentials in the config.rb
file.
TweetStream.configure do |config|
config.consumer_key = '[your twitter app consumer key]'
config.consumer_secret = '[your twitter app consumer secret]'
config.oauth_token = '[your oauth token]'
config.oauth_token_secret = '[your oauth token secret]'
config.auth_method = :oauth
end
ruby tracker.rb