Hi Boris,
You've added some good WDL updates recently, especially the moon phase/rise/set feature.
Please could I ask for one more update: to add the following information to the clientrawextra.txt file:
Field #482: Days since last rain
Field #534: Yesterday rain (mm)
Info taken from the WDL parser at http://www.tnetweather.com/wd-parser.php
WD Live will display this information on the 'live' screen if it is provided.
It's about the only 'live' data that Meteohub does not currently provide, so it would be a good addition.
Many thanks as always,
Mark.
More rainfall data
Moderator: Mattk
-
- Senior Boarder
- Posts: 63
- Joined: Wed Nov 05, 2008 4:25 pm
- Location: Maidstone, Kent, UK
- Contact:
-
- Senior Boarder
- Posts: 63
- Joined: Wed Nov 05, 2008 4:25 pm
- Location: Maidstone, Kent, UK
- Contact:
Re: More rainfall data
Thank you Boris. I see that 4.7 includes the 'Yesterday's rain' feature.
'Days since last rain' does not seem to be implemented yet. Hopefully this can be added when you have time.
Mark.
'Days since last rain' does not seem to be implemented yet. Hopefully this can be added when you have time.
Mark.
- YJB
- Platinum Boarder
- Posts: 387
- Joined: Thu Feb 19, 2009 5:53 pm
- Location: Venhuizen, Netherlands
- Contact:
Re: More rainfall data
Not sure what you are trying to do, but this is the code that I'm using in my testtags.php script:
Hope this helps,
Ysbrand
Code: Select all
// Fetch daily rain_array, this starts with yesterday
$rain_day_string = "[seqday1_rain0_total_mm]";
$rain_day_array = explode(" ", $rain_day_string);
// Need to insert todays rain at the start of the array
array_unshift($rain_day_array,"[day1_rain0_total_mm]");
// Now find the 1st non 0.00 day
while ($rain = current($rain_day_array)) {
if ($rain != 0.00) break;
next ($rain_day_array);
}
$dayswithnorain = key($rain_day_array);
//
//get timestamp for the last recorded rain
$rain_time = strtotime("-".$dayswithnorain." day");
//format the date using the timestamp generated
$dateoflastrainalways = date("d/m/Y", $rain_time);
Ysbrand