Page 1 of 1

Saratoga Base-World template switching from WU-forecast to DS-forecast

Posted: Mon 03 Dec 2018 12:04 am
by saratogaWX
Today, 02-Dec-2018, I've made the switch in the Base-World distribution to default to using as the forecast source (from WeatherUnderground WU-forecast) since WU is:
1) no longer issuing API keys and
2) deprecating their current API at the end of 2018.

While WU has said they'll offer a replacement API to PWS data submitters, that API is still vaporware at this time and it just makes sense to bite the bullet and switch to a different worldwide, multilingual source for the Base-World template distribution.

The 02-Dec-2018 update available from the update tool page includes a Settings.php with WU data removed and DarkSky data settings included. It also includes the current release of DS-forecast.php/DS-forecast-lang.php scripts.
For Base-*, an updated check-fetch-times.php, ajax-dashboard.php and wxforecast.php are included to support using DS-forecast.php in the template set.

Please note that the DS-forecast.php has a different method to specify forecast locations (by Name and latitude,longitude).

For those with currently working WU API keys, update ALL the files from the update tool page except Settings.php and your WU-forecast.php will continue to work as long as the WU-API is still available. You can add the needed values to your existing Settings.php (just commenting out the $SITE['fcstscript'] = 'DS-forecast.php'; and $SITE['fcstorg'] = 'DarkSky'; variables) and WU will continue to work on your site. See the Settings-DarkSky-README.txt for the variables to add to Settings.php.

I'll continue to follow the discussions at the WU API thread, and if the replacement WU-API provides 7-day, multilingual forecasts, I'll do an update to WU-forecast.php to use it -- if not, the WU-forecast.php script will simply be deprecated.

Best regards,

Re: Saratoga Base-World template switching from WU-forecast to DS-forecast

Posted: Sat 08 Dec 2018 7:22 pm
by saratogaWX
I've done an update to the DarkSky scripts today (8-Dec-2018) DS-forecast.php V1.05, DS-forecast-lang.php V1.04 that has the following additions:

1) a new current-conditions block can now be displayed (default is to display it). DarkSky JSON has a current entry with conditions from a nearby station generally available. The Icon, conditions, sunrise/set, distance from forecast point and overall summary are displayed in the block. This is similar to the display with the ec-forecast.php script for Canadian forecasts.

2) if precipitation is forecast, the type of precip (rain, snow, sleet) also appears in the text forecast like the 'Chance of precipitation (rain) nn%'.

3) since DarkSky has a very limited set of icons specified (currently limited to clear-day, clear-night, rain, snow, sleet, wind, fog, cloudy, partly-cloudy-day, or partly-cloudy-night), I've added a routine to use the cloud-coverage (converted to octets) to change the clear-*, partly-cloudy-* specs to use SKC, FEW, SCT, BKN, OVC icons as appropriate. Also, for wind icon, the same cloud-coverage is applied.
Even with these changes, DarkSky continues to use -night icons when talking about full-day forecasts sometimes.

Update is available from the scripts page (update both scripts) and the Template update tool page ( query for 08-Dec-2018, Base-World, *-plugin)

Re: Saratoga Base-World template switching from WU-forecast to DS-forecast

Posted: Sat 08 Dec 2018 9:09 pm
by Mapantz
Hi Ken.

Nice update. I currently have the reverse re wind icons. It shows the day icon for me while it is nighttime.

Re: Saratoga Base-World template switching from WU-forecast to DS-forecast

Posted: Sat 08 Dec 2018 10:37 pm
by saratogaWX
DarkSky API returns only one 'wind' icon irrespective of day or night. Based on cloud coverage octets, I substitute the wind_<sky>.jpg icon where <sky> is one of skc,few,sct,bkn,ovc for the image, but only a day-image is used.