This repository contains the notebook for a demo of using Twitter data I presented at ResBaz Aotearoa 2022.
If you want to run the demo notebook on your own computer, follow these steps.
You will need to be running Linux, or on Windows with WSL2.
- Install
jq
and Jupyter Notebook. On Ubuntu (including inside WSL2), you can runsudo apt install jq jupyter-notebook
. - Clone this repository.
- In a shell, run
pip install -r requirements.txt
. This will set up all the Python dependencies. Advanced users may wish to set up a Python virtual environment for this notebook first. - Run
python -m spacy download en_core_web_sm
- this will download and install the SpaCy language model needed in the notebook. - Register for a Twitter Developer account, then run
twarc2 configure
. Twarc will prompt you for API credentials. Subsequent uses of twarc will be able to make requests to Twitter without asking for your credentials again. - You can now run Jupyter Notebook.
jupyter notebook
A browser window should open showing the Jupyter Notebook interface. Click onsmd-demo.ipynb
.