Giter Club home page Giter Club logo

covid19_germany_rki_telegrambot's Introduction

COVID-19 Germany RKI Telegrambot

This repo contains a python script that helps you make a telegram bot which informs others about cases of COVID-19 based on data from the Robert Koch Institute.

Feel free to improve. Runs great on a Raspberry Pi Zero W which is also the target platform.

Features

  • Option to export data info to .mp3-Audio files (might be useful for people with visual impairment)
  • Send Telegram Messages to a single user / chat group / channel
  • Two timing options for sending messages: Send them every day at a set time or send them as soon as new data is available
  • Save raw data for selected counties in a separate JSON-File

Before you start

Enter your parameters in the settings.py-file. Then run in a terminal: python3 main.py. You may run several instances of the bot on the same machine. Make sure that every instance gets its own working directory. Otherwise the instances may access the same backup file which will result in wrong data.

Basic requirements

Requirements for broadcasting to a Telegram Channel

  • Admin access to Telegram Channel
  • Knowledge about Telegram Channel ID
  • Bot in Telegram Channel with admin access

Requirements for voice output

  • Audio output hardware ready to go
  • gtts package: sudo pip3 install gTTS
  • mpg321 package installed (ask your default linux package manager)

FAQ

  • How do i change the settings of the scipt?
    → Edit the settings.py-file, then restart main.py
  • Can i set multiple counties as options?
    → Yes. Just add them to the counties list in settings.py, then restart main.py.
  • Does the script halt?
    → Not by design. To stop the script you have to abort the task manually. For permanent use on a Raspberry Pi it might be useful to use the tool "screen". This makes it possible to keep the script running even if you are logged out.
  • The sent data is outdated. Where does this error come from?
    → The RKI database doesn't always give you the most recent data. You may have to send a request multiple times for a few minutes to get an current data record. The permanent update mode does not have this issue.
  • Is it necessary to stay connected to the internet all the time?
    → For the mode that sends data as soon as it is available it is obviously necessary to be online all the time. If you just send data at a set time, it's just necessary to stay online 10 Minutes before. Say you want send data at 11 a.m., make sure the host system is online at 10:50 a.m. until the messages are sent. The 10 Minutes are there to buffer the information so it will be sent right on time.

Known Issues

  • When started, the script looks for a backup file. If the file is already there, it is assumed to be a backup file that contains at least data from the previous day. So if you run the script for a day, then turn it off for a several days and then restart it, the script does not calculate the new cases between this day and the day before, but the cases between this day and the day the backup file was last edited.

covid19_germany_rki_telegrambot's People

Contributors

trolliverpust avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.