Skip to content

Instantly share code, notes, and snippets.

@dewomser
Last active October 24, 2024 04:00
Show Gist options
  • Save dewomser/37bee8b04be32a985489ee65cbdadd30 to your computer and use it in GitHub Desktop.
Save dewomser/37bee8b04be32a985489ee65cbdadd30 to your computer and use it in GitHub Desktop.
Get temperature from an API. Decide if hot or cold. A very short Bashscript
#!/bin/bash
t=$(curl -s https://wetter.hs-worms.de/api/v3/data | jq '.temperature.out')
t1=15
a=$(echo "$t<$t1"|bc)
#testa failed =$(( t<t1 ))
if [[ $a -eq 1 ]]; then
echo "Uh, this is cold !"
else
echo "Uff,rather warm !"
fi
@dewomser
Copy link
Author

Dieses Script ist Teil meines Vortrags gewesen. API
https://www.untergang.de/index.php/konferenzen-thema-linux/lpd-23-1-in-worms.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment