Skip to content

flopp/dreisam-pegel-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dreisam-pegel-bot

This is a Mastodon bot that regularly posts information about the current water level of the Dreisam river in Freiburg/Germany.

https://freiburg.social/@dreisampegel

How it works:

  1. The bot is activated every couple of hours by a cronjob
  2. It fetches the current water level data from the official water level site (https://www.hvz.baden-wuerttemberg.de/pegel.html?id=00389) and stores it into a timeseries CSV file
  3. If the water level is critically high (>105cm, at which there are closures of nearby bike lanes) or the last post was > 1 day ago, it will contine
  4. A chart is rendered from the CSV file using https://github.com/fogleman/gg
  5. A Mastodon post is made using https://github.com/mattn/go-mastodon, which includes the rendered chart, was well as some additional information

Some Images:

The "normal" chart (no critical water level); current time is on the right, 1 week history to the left:

Normal chart

The "critical" chart (water level > 105cm); note that there are three official criticality levels (105cm, 125cm, 145cm) at which certain actions are performed (e.g. closure of paths along the river, etc.) - they are marked as horizontal lines.

Chart with critical water level

The actual measuring station near Freiburg-Ebnet:

The actual measuring station

About

A mastodon bot that regularly posts the water level of the Dreisam (river in Freiburg/Germany).

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •