updated styling

This commit is contained in:
Elias Renman
2024-06-08 16:50:33 +02:00
parent 85814083ce
commit 7976f8cac5
14 changed files with 623 additions and 125 deletions

View File

@@ -2,12 +2,8 @@
LOC="$1"
# HTML encode string as %20
LOCATION=$(sed -e "s/ /%20/g" <<<"$LOC")
content=$(curl -sS "https://thisdavej.azurewebsites.net/api/weather/current?loc=$LOCATION&deg=C")
ICON=$(curl -s 'https://wttr.in/?format=1' | sed 's/[+0-9a-cA-Z°-]//g' )
TEMP=$(curl -s 'https://wttr.in/'${LOC}'?format=%t\n&m')
ICON=$(curl -s 'https://wttr.in/'${LOC}'?format=1' | grep -o '^\S*' )
# echo $ICON
TEMP=$(echo $content | jq -r '. | "\(.temperature)°\(.degType)"' | sed 's/"//g')
TOOLTIP=$(echo $content | jq -r '. | "\(.temperature)°\(.degType)\n\(.skytext)"' | sed 's/"//g')
CLASS=$(echo $content | jq .skytext)
echo '{"text": "'$TEMP'", "tooltip": "'$ICON $TOOLTIP $LOC'", "class": '$CLASS' }'
echo '{"text": "'$TEMP'", "tooltip": "'$ICON' '$LOC'", "class": "weather" }'