Loop weather script fetch/display logic

master
Miles Alan 4 years ago
parent 95e36ccec2
commit fe15eb6755
  1. 32
      scripts/appscripts/sxmo_weather.sh

@ -95,21 +95,23 @@ printtables() {
} }
getweathertexttable() { getweathertexttable() {
LAT="$1" while true; do
LON="$2" LAT="$1"
PLACE="$3" LON="$2"
downloadweatherxml "$LAT" "$LON" 2>/dev/null PLACE="$3"
TEMP="$(weatherdata "//temperature" "hourly")" downloadweatherxml "$LAT" "$LON" 2>/dev/null
RAIN="$(weatherdata "//probability-of-precipitation" ".")" TEMP="$(weatherdata "//temperature" "hourly")"
WIND="$(weatherdata "//wind-speed" ".")" RAIN="$(weatherdata "//probability-of-precipitation" ".")"
#LOCATION="$(weatherdata "//location/description" ".")" WIND="$(weatherdata "//wind-speed" ".")"
TIME="$( #LOCATION="$(weatherdata "//location/description" ".")"
weatherdata "//start-valid-time" "." | TIME="$(
grep -oE 'T[0-9]{2}' | tr -d 'T' | tr '\n' ' ' weatherdata "//start-valid-time" "." |
)" grep -oE 'T[0-9]{2}' | tr -d 'T' | tr '\n' ' '
tput rev; echo "$PLACE"; tput sgr0 )"
printtables tput rev; echo "$PLACE"; tput sgr0
read -r printtables
read -r
done
} }
weathermenu() { weathermenu() {

Loading…
Cancel
Save