TweetGrabber is a set of Ruby scripts for pulling in the tweets of people and hashtags you want to follow.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


TweetGrabber is a set of Ruby scripts for pulling in the tweets of people and hashtags you want to follow.



  • Ruby >= 1.9.2
  • Rails 3 >= 3.1 or Rails 4
  • MongoDB >= 2.4.3

Ruby Gems

  • logger >= 1.2.8
  • tweetstream >= 2.5.0
  • smarter_csv >= 1.0.10
  • mongo >= 1.9.1


Assuming that you have a MongoDB replication set up and running, have created a database and a collection, and also have Ruby and Rails installed...

  1. Create [a Twitter application( to use for your TweetGrabber

  2. Create an oAuth token in your Twitter application by clicking the "Create my access token" button at the bottom of your app page and save all of the credentials (from the Details and OAuth tool tabs)

  3. Download the TweetGrabber source and unpack into a directory

  4. Open lib/tweetgrabber.rb, and update the configuration variables in the "Config Variables" section

  5. Create a CSV file to hold the Twitter information for the people you want to follow. There's an example file you can use in the root folder. If you need to get a Twitter ID for a user account, I suggest using

  6. Install the required gems via Bundler (bundle install)

  7. At the command line, run the following command:

    ruby lib/tweet_grabber.rb

  8. Enjoy the tweets!

To Follow Keyword Terms

Do all of the above, but instead of creating a CSV file of users, add a list of terms to the keywords_to_track array in the lib/hashtag_grabber.rb file.


  1. When using the hashtag_grabber.rb script, I've found it unnecessary to use the '#' part of a hashtag in order to actually follow that hashtag.
  2. When naming your database and collection in Mongo, I highly recommend using words separated by underscores, such as "tweet_database".

Need Help?

TweetGrabber was written by me, Robert Dempsey. As such, I'm happy to help you out if you need it. Please file an issue if something isn't working for you.

You can also contact me tons of other ways:

Want To Contribute?

Awesome. Please fork the project and send me a pull request!


TweetGrabber is licensed under the MIT License (MIT). Read about what that means to you, or read the LICENSE file.