Run setup.sh
to download and install the required packages
bash setup.sh
Add your twitter API keys in a file called twitterAPIkeys.json
in the src
folder, in the following format:
{
"API key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"API secret key" : "xxxxxxxxxxxxxxxxxxxx",
"Access token": "xxxxxxxxxxxxxxxxxxxxxxx",
"Access token secret": "xxxxxxxxxxxxxxxx"
}
cd src
python main.py "seach_term" [-n number_of_tweets]
Make sure you are in the src
folder. Run main.py
, for example python main.py "#Covid" -n 500
. An output file plot.html
will be generated in the output
folder. Hovering on the points shows you the tweet. The size of the points will be proportional to the number of the likes on the tweet.
As the plot is interactive and requires javascript, it cannot embedded in this README. To see a generated plot use the following link, hovering on the points shows you the tweet: Sample Plot.