From 4d5bab6ce6cd6dfb5f13ce8bd517c5906d30bad0 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Fri, 22 Apr 2022 19:25:48 +0100 Subject: Add wind direction --- index.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index f3280ba..c3caaca 100644 --- a/index.php +++ b/index.php @@ -22,6 +22,7 @@ $curtemp = $arr_json['currentTemprature']; $maxtemp[0] = $arr_json['forecastDay']['0']['maxTemp']; $mintemp[0] = $arr_json['forecastDay']['0']['minTemp']; $wind[0] = $arr_json['forecastDay']['0']['windSpeed']; +$winddirection[0] = $arr_json['forecastDay']['0']['windDirection']; $uv[0] = $arr_json['forecastDay']['0']['uvIndex']; $morning[0] = $arr_json['forecastDay']['0']['morningDescripiton']; // Try to... $afternoon[0] = $arr_json['forecastDay']['0']['afternoonDescripiton']; // ...find a... @@ -35,6 +36,7 @@ $winddesc[0] = $arr_json['forecastDay']['0']['windDescription']; $maxtemp[1] = $arr_json['forecastDay']['1']['maxTemp']; $mintemp[1] = $arr_json['forecastDay']['1']['minTemp']; $wind[1] = $arr_json['forecastDay']['1']['windSpeed']; +$winddirection[1] = $arr_json['forecastDay']['1']['windDirection']; $uv[1] = $arr_json['forecastDay']['1']['uvIndex']; $morning[1] = $arr_json['forecastDay']['1']['morningDescripiton']; $afternoon[1] = $arr_json['forecastDay']['1']['afternoonDescripiton']; @@ -52,7 +54,7 @@ if ($timenow >= strtotime($sunset[0])) { $summary[0] = "00:00: $morning[0] 12:00: $afternoon[0] $sunset[0]: $night[0]"; } -echo "Max $maxtemp[0], Min $mintemp[0], Cur $curtemp, UV $uv[0], Wind $wind[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]\n\n"; echo "\n\n"; echo "\n\n"; @@ -61,7 +63,7 @@ echo "

Forecasts | Graphs

\n\n"; echo "

Today

\n\n"; //echo "

$valid[0]

\n"; // If a day summary is found, use a sensible time range here -echo "Max: $maxtemp[0], Min: $mintemp[0], Current: $curtemp, UV Index: $uv[0], Wind: $wind[0]

\n"; +echo "Max: $maxtemp[0], Min: $mintemp[0], Current: $curtemp, UV Index: $uv[0], Wind: $wind[0] $winddirection[0]

\n"; echo "Morning: $morning[0]

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

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

\n"; @@ -70,7 +72,7 @@ echo "Wind: $winddesc[0]

\n"; echo "

Tomorrow

\n\n"; //echo "

$valid[1]

\n"; -echo "Max: $maxtemp[1], Min: $mintemp[1], UV Index: $uv[1], Wind: $wind[1]

\n"; +echo "Max: $maxtemp[1], Min: $mintemp[1], UV Index: $uv[1], Wind: $wind[1] $winddirection[1]

\n"; echo "Morning: $morning[1]

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

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

\n"; -- cgit v1.2.3