Code Monkey home page Code Monkey logo

covid-19-incidence-notifier's Introduction

covid-19-incidence-notifier

🤒⏰ Get notified about new COVID-19 incidences in your location (Norway only)

Docker Pulls Docker Image Size

Notifies on Discord if there are new COVID-19 incidences in your location (Norway only). Uses the Corona API from vg.no about incidences in municipalities. It notifies to a Discord channel using Discord Webhooks.

COVID-19 incidence notification example

Usage

Within a Docker container

From Docker Hub Image

This will pull the image from Docker Hub and run the image with the provided configuration for web hooks as below. One can provide only the Webhook URL or both the Webhook ID and token.

# Providing Discord Webhook URL
$ docker run -d -e DISCORD_WEBHOOK_URL=<URL_HERE> knutkirkhorn/covid-19-incidence-notifier

# Providing a single area ID
$ docker run -d \
    -e DISCORD_WEBHOOK_URL=<URL_HERE> \
    -e AREA_IDS=1577 \
    knutkirkhorn/covid-19-incidence-notifier

# Providing two area IDs
$ docker run -d \
    -e DISCORD_WEBHOOK_URL=<URL_HERE> \
    -e AREA_IDS=1577,4651 \
    knutkirkhorn/covid-19-incidence-notifier

From source code

# Build container from source
$ docker build -t covid-19-incidence-notifier .

# Run the built container with default configuration
$ docker run -d -e DISCORD_WEBHOOK_URL=<URL_HERE> covid-19-incidence-notifier

# Providing a single area ID
$ docker run -d \
    -e DISCORD_WEBHOOK_URL=<URL_HERE> \
    -e AREA_IDS=1577 \
    covid-19-incidence-notifier

# Providing two area IDs
$ docker run -d \
    -e DISCORD_WEBHOOK_URL=<URL_HERE> \
    -e AREA_IDS=1577,4651 \
    covid-19-incidence-notifier

Outside of a Docker container

# Install
$ npm install

# Run
$ npm start

Environment variables

Provide these with the docker run command or store these in a .env file. Only DISCORD_WEBHOOK_URL or both DISCORD_WEBHOOK_ID and DISCORD_WEBHOOK_TOKEN are required, but other values are recommended to change to its own personal usage.

  • DISCORD_WEBHOOK_URL
    • URL to the Discord Webhook containing both the ID and the token
    • Format: DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/<ID_HERE>/<TOKEN_HERE>
  • DISCORD_WEBHOOK_ID
    • ID for the Discord Webhook
  • DISCORD_WEBHOOK_TOKEN
    • Token for the Discord Webhook
  • WAIT_TIMEOUT (optional)
    • The time interval in milliseconds between each check to the APIs.
    • Default: 3600000 (60 minutes)
  • AREA_IDS (optional)
    • The area ID(s) of the municipality/municipalities to notify about new incidences. Specified as a single four digit number or comma separeted list of four digit numbers.
    • Default: 1577 (Volda)
    • Different municipality IDs can be viewed here.

License

MIT © Knut Kirkhorn

covid-19-incidence-notifier's People

Contributors

knutkirkhorn 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.