Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/frefrik/covid19norge-telegram-bot

πŸ’¬ Telegram bot for tracking live COVID-19 statistics in Norway
https://github.com/frefrik/covid19norge-telegram-bot

covid covid-19 covid19 norge norway smittestopp telegram telegram-bot vaccine

Last synced: about 1 month ago
JSON representation

πŸ’¬ Telegram bot for tracking live COVID-19 statistics in Norway

Awesome Lists containing this project

README

        

# COVID-19 Norge - Telegram Bot


COVID-19 Norge

*(Preview)*


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

The bot autoposts live COVID-19 updates to a group/channel/user of your choosing:
```yaml
bot:
token: BOT_TOKEN
autopost:
chatid: CHAT_ID
```

Bot is live in this channel: [COVID-19 Norge](https://t.me/s/covid19norge)

## Screenshots
#### Live Updates


c19_stats
c19_live

#### Graphs


c19_graphs-1
c19_graphs-2

#### RSS


c19_rss

## Features
### Autopost:

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

### Available functions:
- /help - Show commands
- /stats - COVID-19 statistikk Norge
- /tested - Graf over testede i Norge
- /confirmed - Graf over smittede i Norge
- /dead - Graf over dΓΈdsfall i Norge
- /hospitalized - Graf over sykehusinnleggelser i Norge
- /vaccine - Graf over antall personer vaksinert i Norge
- /smittestopp - Graf over data fra Smittestopp

## Installation

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

services:
bot:
container_name: covid19norge-telegram-bot
image: frefrik/covid19norge-telegram-bot
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-telegram-bot/master/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-telegram-bot.git
$ cd covid19norge-telegram-bot/
```
##### Copy `config.dist.yml` to `config.yml` and edit configuration
```shell
$ cd config/
$ cp config.dist.yml config.yml
```

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

---

#### 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-telegram-bot
```
##### Bot logs
Use `docker logs -f covid19norge-telegram-bot` to show informational logs.

---
### 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/onfig.yml
```

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

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

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