New backup 2024-05-01 20:00:02
This commit is contained in:
parent
c9da6e7606
commit
c7f2603a19
1 changed files with 3 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#jweather=$( curl --silent wttr.in/?format=j1 )
|
jweather=$( curl --silent wttr.in/?format=j1 )
|
||||||
jweather=$( cat ~/weather.json )
|
#jweather=$( cat ~/weather.json )
|
||||||
|
|
||||||
current_f=$( jq -r '.current_condition.[].FeelsLikeF' <<< ${jweather} )
|
current_f=$( jq -r '.current_condition.[].FeelsLikeF' <<< ${jweather} )
|
||||||
high_f=$( jq -r '.weather.[0].maxtempF' <<< ${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' )
|
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
|
if [[ ${check_hour#0} -ge ${current_hour#0} ]];then
|
||||||
echo "future"
|
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
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue