Patrick Menlove - 2250066M
This code is part of an academic assignment of Web Science - University of Glasgow.
You can use conda
to create a virtualenv with all required dependencies
conda env create -f environment.yml
The example also uses Docker to run a MongoDB instance with the sample data.
docker-compose up -d
If you would like to run the save_tweets.py
file to ingest new tweets, you will need to set up the .env
file with the following environment variables, corresponding to the Twitter API credentials
TWITTER_CONSUMER_KEY
TWITTER_CONSUMER_SECRET
TWITTER_ACCESS_TOKEN
TWITTER_ACCESS_TOKEN_SECRET
If you would like to use the sample data, do not run save_tweets.py
as this will begin appending to the dataset and may skew the values.
The flow of execution then should be:
process_tweets.py
data_stats.py
prune_data.py
analyse_crowdsource.py
All data is inspectable under the data/
path. If the MongoDB data archive does not work, the tweet data used is also supplied in csv
format in this path.