- python3
- quarto - https://quarto.org/
Install Python requirements with:
pip3 install -r requirement.txt
For 1. to authenticate with the Twitter API a valid bearer token needs to be present as
an environment variable named TWITTER_BEARER_TOKEN
:
export TWITTER_BEARER_TOKEN=<xxxxxxx>
get_tweets.py
- downloads 5 minutes worth of data from the Twitter API V2 sample stream, and all tweets with the keywords "pregnancy" and "childbirth" in the same period and stores indata
folder in a timestamped subdirectory.analyse_sentiment.py
- runsnltk
sentiment analyser on tweets gathered by 1. and stores combined data as csvs. Twitter isn't very good at returning a "lang" attribute, so also filter out non-English tweets here usingnlp
package.
WIP.
quarto preview explore.qmd