New backup 2024-05-01 20:00:02

This commit is contained in:
Penelope Gwen 2024-05-01 20:00:02 -06:00
parent c9da6e7606
commit c7f2603a19

View file

@ -1,7 +1,7 @@
#!/bin/bash
#jweather=$( curl --silent wttr.in/?format=j1 )
jweather=$( cat ~/weather.json )
jweather=$( curl --silent wttr.in/?format=j1 )
#jweather=$( cat ~/weather.json )
current_f=$( jq -r '.current_condition.[].FeelsLikeF' <<< ${jweather} )
high_f=$( jq -r '.weather.[0].maxtempF' <<< ${jweather} )
@ -17,7 +17,7 @@ for h in {0..7};do
check_hour=$( date -d $( jq -r --argjson h ${h} '.weather.[0].hourly.[$h].time' <<< ${jweather} ) +'%H' )
if [[ ${check_hour#0} -ge ${current_hour#0} ]];then
echo "future"
hourly_forecast="${hourly_forecast}\n${check_hour}: "$( jq -r --argjson h ${h} '.weather.[0].hourly.[$h].weatherDesc.[].value' <<< ${jweather} )", "$( jq -r --argjson h ${h} '.weather.[0].hourly.[$h].FeelsLikeF' <<< ${jweather} )"°F"
hourly_forecast="${hourly_forecast}\n${check_hour}00: "$( jq -r --argjson h ${h} '.weather.[0].hourly.[$h].weatherDesc.[].value' <<< ${jweather} )", "$( jq -r --argjson h ${h} '.weather.[0].hourly.[$h].FeelsLikeF' <<< ${jweather} )"°F"
fi
done