Last active
April 21, 2024 22:41
-
-
Save dewomser/8be2f3a36f9737d35fa3c6542b8bd980 to your computer and use it in GitHub Desktop.
Wetter Hochschule Worms
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
#!/bin/bash | |
u=$(curl -X 'GET' \ | |
'https://wetter.hs-worms.de/api/v3/data' \ | |
-H 'accept: application/json') | |
temperatur=$(echo $u|jq ".temperature.out") | |
vorhersage=$(echo $u|jq '.forecast.rule') | |
barometer=$(echo $u|jq '.baro') | |
regenrate=$(echo $u|jq '.rain.rate') | |
windrichtung=$(echo $u|jq '.wind.dir.text') | |
windgeschw=$(echo $u|jq '.wind.speed.kmh') | |
feuchte=$(echo $u|jq '.humidity.out') | |
datum=$(date) | |
echo "#Wetterstation Hochschule #Worms meldet:" > wetter2.txt | |
echo "$datum" >> wetter2.txt | |
echo "Temperatur: $temperatur °C" >> wetter2.txt | |
echo "Barometer: ${barometer:0:4} hPa" >> wetter2.txt | |
echo "Luftfeuchte: $feuchte %" >> wetter2.txt | |
echo "Regenrate: $regenrate mm/h" >> wetter2.txt | |
echo "Windrichtung: $windrichtung" >> wetter2.txt | |
echo "Windgeschwindigkeit: $windgeschw km/h" >> wetter2.txt | |
cat wetter2.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wetter von der Wtterstation Hochschule Worms anzeigen
Angepasst an die neue API 22.04.2024