Scrapes Twitter for data attached to a certain hashtag or user mention. Mentions in the tweet are saved to a database to be evaluated later. This is a tool for saving tweets related to certain hashtags, mentions, or phrases for data analysis later. Tweets are saved to a MongoDB and analysis of the tweets is left open to the user for their specific needs.
- Install MongoDB, http://docs.mongodb.org/manual/installation/
- Create
dev_tweets
andtweets
databases and users
mongo
use dev_tweets
db.createUser(
{
user: 'twitterScraper',
pwd: 'twitterScraper',
roles: [ "readWrite", "dbAdmin" ]
}
)
use tweets
db.createUser(
{
user: 'twitterScraper',
pwd: 'twitterScraper',
roles: [ "readWrite", "dbAdmin" ]
}
)
- Clone project to your machine
- Create a virtualenv for twitter-scraper
- Start that virtualenv
pip install -r requirements.txt
- Edit
twitter-scraper.py
- Enter your Twitter Application Keys, https://apps.twitter.com
- Enter what you would like to be watching for on Twitter
- Verify MongoDB users and database address
- Save
- Run
python twitter-scraper.py
- For developer mode, to save to dev_tweets, run with
-d true
- For verbose output to console run with
-v true
Clone the repository and open a pull request to be merged back in.