Last active
August 23, 2023 10:20
-
-
Save xentec/5a7392a0c5b744c81a28ffd269931359 to your computer and use it in GitHub Desktop.
CLI mensa plan for OTH Regensburg. Requires Nushell to run.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env nu | |
let now = (date now) | |
let week = ($now | format date '%V' | str trim -l -c '0') | |
let url = $"https://www.stwno.de/infomax/daten-extern/csv/HS-R-tag/($week).csv" | |
( | |
http get --raw $url | | |
decode "iso-8859-1" | | |
str replace -a "\n(\n|(;|\\())" "$2" | # fix bullshit | |
from csv -s ";" | | |
where datum == ($now | format date "%d.%m.%Y") | | |
update name {|row| $row.name | str replace '([^\(]+)\(.+\)' '$1' } | | |
select warengruppe name kennz stud bed | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment