Last active
April 4, 2025 17:31
-
-
Save dewomser/4f188c72e94fbfd9fcaf9a928b54df69 to your computer and use it in GitHub Desktop.
Pegelstände Deutsche Gewässer als csv oder als Echtzeittext
This file contains hidden or 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
| Funktioniert immer https://pegelonline.wsv.de/gast/pegeltabelle | |
| Beispiel Helgoland Binnenhafen | |
| datum=$(date '+%d.%m.%Y');pegel=$(curl "https://pegelonline.wsv.de/webservices/files/Wasserstand+Rohdaten/NORDSEE/c0ec139b-13b4-4f86-bee3-06665ad81a40/$datum/down.txt" 2>&1 | grep ^[0-2][0-9]:[0-5][0-9]#[0-9] | tail -1 | cut -c 7- | tr -d '\r') ; echo Pegel in Helgoland: $pegel cm | |
| Pegel in Helgoland: 401 cm |
This file contains hidden or 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
| # Pegelstand als csv für Grafik (1-liner geändert und geprüft 02.05.2024 ) | |
| #funktioniert nicht mehr | |
| wetterdienst values --provider=wsv --network=pegel --si-units=True --station=23900200 --resolution=dynamic --parameter=stage --format=csv > pegel.csv | |
| #funktioniert noch nicht richtig . Ausgabe csv | |
| datum=$(date '+%d.%m.%Y');pegel=$(curl "https://pegelonline.wsv.de/webservices/files/Wasserstand+Rohdaten/RHEIN/844a620f-f3b8-4b6b-8e3c-783ae2aa232a/$datum/down.txt") 2>&1; echo $((pegel)); | |
| # Pegelstand Echtzeit als Text (1-liner geändert und geprüft 02.05.2024) | |
| datum=$(date '+%d.%m.%Y');pegel=$(curl "https://pegelonline.wsv.de/webservices/files/Wasserstand+Rohdaten/RHEIN/WORMS/$datum/down.txt" 2>&1 | grep "^[0-2][0-9]:[0-5][0-9]#[0-9]" | tail -1 | cut -c 7- | tr -d '\r') ; echo Pegel in Worms: "$pegel" cm |
Author
Author
Es gibt viele Möglichkeiten den Pegel zu greppen
Author
1-liner verbessert und geshellcheckt
Author
Pegel für Worms Methode UIID
datum=$(date '+%d.%m.%Y');pegel=$(curl "https://pegelonline.wsv.de/webservices/files/Wasserstand+Rohdaten/RHEIN/844a620f-f3b8-4b6b-8e3c-783ae2aa232a/$datum/down.txt" 2>&1 | grep ^[0-2][0-9]:[0-5][0-9]#[0-9] | tail -1 | cut -c 7- | tr -d '\r') ; echo Pegel in Worms: $pegel cm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bash 1-Liner mit wetterdienst . Pegelstand an Deutschen Gewässern, Beispiel Worms/Rhein
Eine Liste aller Pegelnummern (station) gibt es z.B. hier: https://www.pegelonline.wsv.de/gast/pegeltabelle