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

https://github.com/scriptex/vik-varna-alerts

Email and web notifications for planned repairs from ViK-Varna
https://github.com/scriptex/vik-varna-alerts

cron email-alert web-alert

Last synced: 7 months ago
JSON representation

Email and web notifications for planned repairs from ViK-Varna

Awesome Lists containing this project

README

          

# ViK Varna Alerts

[![Github Build](https://github.com/scriptex/vik-varna-alerts/workflows/Build/badge.svg)](https://github.com/scriptex/vik-varna-alerts/actions?query=workflow%3ABuild)
[![Send email](https://github.com/scriptex/vik-varna-alerts/actions/workflows/send-email.yml/badge.svg)](https://github.com/scriptex/vik-varna-alerts/actions/workflows/send-email.yml)

[![Codacy Badge](https://app.codacy.com/project/badge/Grade/34d3d75710534dc6a38c3584a1dcd068)](https://www.codacy.com/gh/scriptex/vik-varna-alerts/dashboard?utm_source=github.com&utm_medium=referral&utm_content=scriptex/vik-varna-alerts&utm_campaign=Badge_Grade)
[![Codebeat Badge](https://codebeat.co/badges/d765a4c8-2c0e-44f2-89c3-fa364fdc14e6)](https://codebeat.co/projects/github-com-scriptex-vik-varna-alerts-master)
[![CodeFactor Badge](https://www.codefactor.io/repository/github/scriptex/vik-varna-alerts/badge)](https://www.codefactor.io/repository/github/scriptex/vik-varna-alerts)
[![DeepScan grade](https://deepscan.io/api/teams/3574/projects/5257/branches/40799/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=3574&pid=5257&bid=40799)
[![Analytics](https://ga-beacon-361907.ew.r.appspot.com/UA-83446952-1/github.com/scriptex/vik-varna-alerts/README.md?pixel)](https://github.com/scriptex/vik-varna-alerts/)

> Email and web notifications for planned repairs from ViK-Varna

## About

ViK Varna (ВиК-Варна) is the local water supplier for Varna region in Bulgaria. They post notifications about planned repairs on their website but it is not possible to subscribe to those notifications and receive them immediately - instead one should check their website frequently.

The code in this repository serves as a middleware between the website and the user - it sends hourly notifications on email which contain the latest news related to planned repairs and outages.

The way the code is structured allows for integration with any other website which has a dedicated page for this purpose.

## Usage

In order to use this repository, one must clone it and adjust the repository secrets found under `settings/secrets/actions` in the repository and add their own configuration:

```sh
# The email address of the recipient of the notifications
EMAIL_TO="recipient@example.com"

# The email address of the sender of the notifications
EMAIL_FROM="sender@example.com"

# The web address (URL) of the page that contains the notifications
ALERTS_PAGE="['https://website.notifications/deep/link/1', https://website.notifications/deep/link/2]"

# The subject in the email
EMAIL_SUBJECT="Planned outages and repairs"

# The CSS selector for the HTML element which contains the notifications
DATE_SELECTOR='.item-date-selector'

# The CSS selector for the HTML element which contains the notifications
ALERTS_SELECTOR=".alerts-selector"

# A CSS class name for a single notification element
CHILD_CLASSNAME='alert-item'

# API key for Brevo (formerly known as Sendinblue)
SENDINBLUE_API_KEY="abc-123"
```

## Available ways to use the code in this repository

The code is deployed via Vercel and is running as serverless lambda functions which can be accessed here:

- [the page which contains the alerts](https://vik-varna-alerts.atanas.info/api/alerts)
- [the page which sends an email with the alerts](https://vik-varna-alerts.atanas.info/api/email)

When forked and correctly set up, this repository creates a CRON job which sends an email at 0 (zero) o'clock each hour between 5:00 and 14:00 UTC.

One can adjust this by modifying the parameters in the [action configuration](https://github.com/scriptex/vik-varna-alerts/blob/main/.github/workflows/send-email.yml)

## Visitor stats

![GitHub stars](https://img.shields.io/github/stars/scriptex/vik-varna-alerts?style=social)
![GitHub forks](https://img.shields.io/github/forks/scriptex/vik-varna-alerts?style=social)
![GitHub watchers](https://img.shields.io/github/watchers/scriptex/vik-varna-alerts?style=social)
![GitHub followers](https://img.shields.io/github/followers/scriptex?style=social)

## Code stats

![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/scriptex/vik-varna-alerts)
![GitHub repo size](https://img.shields.io/github/repo-size/scriptex/vik-varna-alerts?style=plastic)
![GitHub language count](https://img.shields.io/github/languages/count/scriptex/vik-varna-alerts?style=plastic)
![GitHub top language](https://img.shields.io/github/languages/top/scriptex/vik-varna-alerts?style=plastic)
![GitHub last commit](https://img.shields.io/github/last-commit/scriptex/vik-varna-alerts?style=plastic)

## LICENSE

MIT

---


Connect with me:






 



 



 



 



 



 



 



 



 



 



 



---


Support and sponsor my work: