From 25ec835300c804c36dc5418b4a5b097069f68cb8 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Fri, 2 Dec 2022 23:24:20 +0000 Subject: Use the wind from the current day period, and add it to the title. --- index.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index 9835fdd..b9a7707 100644 --- a/index.php +++ b/index.php @@ -36,7 +36,7 @@ $afternoon[0] = $arr_json['forecastDay']['0']['afternoonDescripiton']; // ...fin $night[0] = $arr_json['forecastDay']['0']['nightDescripiton']; // ...day summary $sunset[0] = $arr_json['forecastDay']['0']['sunSet']; $frost[0] = $arr_json['forecastDay']['0']['frost']; -$winddesc[0] = $arr_json['forecastDay']['0']['windDescription']; +$winddesc[0] = $arr_json['forecastDay']['0']['windDescription']; // Unused for now // Tomorrow @@ -55,13 +55,17 @@ $winddesc[1] = $arr_json['forecastDay']['1']['windDescription']; if ($timenow >= strtotime($sunset[0])) { $summary[0] = "$sunset[0]: $night[0]"; + $windperiod = $arr_json['forecastDay']['0']['nightWindDescripiton']; } else if ($timenow >= strtotime("12:00:00")) { $summary[0] = "12:00: $afternoon[0] $sunset[0]: $night[0]"; + $windperiod = $arr_json['forecastDay']['0']['afternoonWindDescripiton']; } else { $summary[0] = "00:00: $morning[0] 12:00: $afternoon[0] $sunset[0]: $night[0]"; + $windperiod = $arr_json['forecastDay']['0']['morningWindDescripiton']; + } -echo "Max $maxtemp[0], Min $mintemp[0], Cur $curtemp, UV $uv[0], Wind $wind[0] $winddirection[0], $summary[0] $frost[0]\n\n"; +echo "Max $maxtemp[0], Min $mintemp[0], Cur $curtemp, UV $uv[0], Wind $wind[0] $winddirection[0], $summary[0] $frost[0] $windperiod\n\n"; echo "\n\n"; echo "\n\n"; @@ -75,7 +79,7 @@ echo "Morning: $morning[0]

\n"; echo "Afternoon: $afternoon[0]

\n"; echo "Night: $night[0]

\n"; echo "Frost: $frost[0]

\n"; -echo "Wind: $winddesc[0]

\n"; +echo "Wind: $windperiod

\n"; echo "

Tomorrow

\n\n"; //echo "

$valid[1]

\n"; -- cgit v1.2.3