latest user config

This commit is contained in:
2024-09-13 14:28:50 +02:00
parent cdcaee5943
commit 2f402fe686
59 changed files with 2336 additions and 670 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
for i in {1..5}
do
text=$(curl -s "https://wttr.in/$1?format=1")
if [[ $? == 0 ]]
then
text=$(echo "$text" | sed -E "s/\s+/ /g")
tooltip=$(curl -s "https://wttr.in/$1?format=4")
if [[ $? == 0 ]]
then
tooltip=$(echo "$tooltip" | sed -E "s/\s+/ /g")
tooltip="${tooltip//+/ }"
echo "{\"text\":\"$text\", \"tooltip\":\"$tooltip\"}"
exit
fi
fi
sleep 2
done
echo "{\"text\":\"error\", \"tooltip\":\"error\"}"