https://github.com/simonwhitaker/that-civil-tweet
https://github.com/simonwhitaker/that-civil-tweet
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/simonwhitaker/that-civil-tweet
- Owner: simonwhitaker
- Created: 2021-12-11T12:47:14.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-11-06T09:39:42.000Z (over 3 years ago)
- Last Synced: 2025-01-01T02:29:05.270Z (over 1 year ago)
- Language: Jupyter Notebook
- Size: 146 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Introduction
On 24 May, 2020, a rogue staffer posted a [highly critical tweet](https://www.theguardian.com/politics/2020/may/24/can-you-imagine-having-to-work-with-these-truth-twisters) on the UK Civil Service twitter account. Ever since, [@ThatCivilTweet](https://twitter.com/ThatCivilTweet) has been tweeting the same text twice a day, every day, to keep it fresh in our minds.
The code in this repository queries the Twitter API for the public stats (e.g. like counts) for every tweet from the @ThatCivilTweet account, then offers a Jupyter Notebook for visualising the data in an interactive plot.
# Getting started
To run the code, first register for the [Twitter API](https://developer.twitter.com/en/docs/platform-overview) and generate a bearer token, then export it to your environment:
```
export TWITTER_API_TOKEN=
```
Now run the code.
```
poetry install
poetry run python3 main.py > data.csv
```
Now open viz.ipynb and run it to generate an interactive plot. If you've never used a .ipynb file before, the easiest way to get started is to open it in VS Code with the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) installed.