Author Topic: Saratoga Base-World template switching from WU-forecast to DS-forecast  (Read 93 times)

saratogaWX

  • Strong Breeze
  • ***
  • Posts: 120
  • Weather website programming enthusiast
    • Saratoga-Weather.org
  • Station Details: Davis VP1 +, iMAC 21, OSX 10.6.8
Today, 02-Dec-2018, I've made the switch in the Base-World distribution to default to using DarkSky.net 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,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub, WeatherSnoop, WeatherCat
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Blicj11

  • Storm
  • *****
  • Posts: 3029
    • EW3808
    • KUTHEBER6
    • Timber Lakes Utah
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP™ Data Logger | iMac (late 2013), 3.5 GHz Intel Core i7, 24 GB RAM, macOS Mojave | Sharx SCNC2900 Webcam | Supportive Wife
Re: Saratoga Base-World template switching from WU-forecast to DS-forecast
« Reply #1 on: December 05, 2018, 10:45:59 AM »
Thanks for the information and explanation, Ken. WU is in a long, drawn out death spiral.
Blick


saratogaWX

  • Strong Breeze
  • ***
  • Posts: 120
  • Weather website programming enthusiast
    • Saratoga-Weather.org
  • Station Details: Davis VP1 +, iMAC 21, OSX 10.6.8
Re: Saratoga Base-World template switching from WU-forecast to DS-forecast
« Reply #2 on: December 08, 2018, 07:21:13 PM »
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)
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub, WeatherSnoop, WeatherCat
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP