mirror of
https://github.com/eliasrenman/dotfiles.git
synced 2026-03-17 04:56:07 +01:00
updated styling
This commit is contained in:
@@ -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°=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" }'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user