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
- 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...
Create [a Twitter application(https://dev.twitter.com/) to use for your TweetGrabber
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)
Download the TweetGrabber source and unpack into a directory
Open lib/tweetgrabber.rb, and update the configuration variables in the "Config Variables" section
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 mytwitterid.com.
Install the required gems via Bundler (bundle install)
At the command line, run the following command:
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.
- 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.
- When naming your database and collection in Mongo, I highly recommend using words separated by underscores, such as "tweet_database".
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:
- My personal blog
- Work email: firstname.lastname@example.org
- Work phone: 1-888-968-4332 x517
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.