Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/frefrik/covid19norge-twitter

🐦 Twitter bot for tracking live COVID-19 statistics in Norway
https://github.com/frefrik/covid19norge-twitter

bot covid-19 covid19 koronavirus norge norway python smittestopp twitter twitter-bot vaccine

Last synced: about 1 month ago
JSON representation

🐦 Twitter bot for tracking live COVID-19 statistics in Norway

Awesome Lists containing this project

README

        

# COVID-19 Norge - Twitter Bot


COVID-19 Norge

*https://twitter.com/covid19norge*


## Description
Twitter bot for tracking live COVID-19 statistics in Norway.

The bot autoposts live updates with a [Twitter developer account](https://developer.twitter.com/en/apply-for-access):
```yaml
twitter:
auth:
consumer_key:
consumer_secret:
access_token:
access_token_secret:
```

## DataSource
[https://github.com/frefrik/covid19norge-data](https://github.com/frefrik/covid19norge-data) (accessed through [covid19norge.no/api](https://covid19norge.no/api))

## Features

- **Live updates**
- Tested
- Confirmed cases
- Deaths
- Admissions
- Respiratory
- Vaccine doses
- Smittestopp
- **Graphs**
- Tested
- Confirmed cases
- Dead
- Hospitalized
- Vaccine doses
- Smittestopp
- **RSS**
- News from FHI (Folkehelseinstituttet)
- News from the goverment (Regjeringen)

## Screenshots

Daily Summary Statistics


c19_graphs
c19_stats

Live updates (click to expand)


c19_live

RSS (click to expand)


c19_rss-1
c19_rss-2

## Installation

### Docker
##### Create a file named `docker-compose.yml` and add the following:
```yaml
version: '3.8'

services:
bot:
container_name: covid19norge-twitter
image: frefrik/covid19norge-twitter:latest
restart: unless-stopped
environment:
- TZ=Europe/Oslo
volumes:
- ./config:/app/bot/config
- ./data:/app/bot/data
```

##### Download and edit bot configuration
```shell
$ mkdir -p config \
&& wget https://raw.githubusercontent.com/frefrik/covid19norge-twitter/main/config/config.dist.yml -O config/config.yml
```

##### Start bot
```shell
$ docker-compose up -d
```

---
### git + Docker
##### Clone the repository
```shell
$ git clone https://github.com/frefrik/covid19norge-twitter.git
$ cd covid19norge-twitter/
```
##### Copy `config.dist.yml` to `config.yml` and edit configuration
```shell
$ cp config/config.dist.yml config/config.yml
```

##### Start bot
```shell
$ docker-compose up -d
```

---
### Command line
##### Install dependencies
```shell
$ pip install -r requirements.txt
```

##### Copy `config.dist.yml` to `config.yml` and edit configuration
```shell
$ cp config/config.dist.yml config/config.yml
```

##### Start bot
```shell
$ screen -dmS covid19norge-twitter python clock.py
```

##### Attaching to the screen
```shell
$ screen -r covid19norge-twitter
```

---

#### Docker Notes
##### Editing config
If `config.yaml` is updated while bot is running, the container must be restarted to use the updated config.
```shell
$ docker restart covid19norge-twitter
```
##### Bot logs
Use `docker logs -f covid19norge-twitter` to show informational logs.