Skip to content

bry/twitter-stream-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twitter Stream Tracker

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.

Installation

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

Configuration

Stop words, execution time limit and tweetstream gem Twitter credentials are configurable in the config.rb file.

Stop words

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 &amp & e o te The be so los para like I'm do se)
Execution Time Limit

Set program to terminate in X number of seconds.

TERM_IN_SECONDS = 300
Twitter App Credentials

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

Usage

ruby tracker.rb

Image demo

About

Twitter live stream word tracker with stop word filter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages