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

0 Members and 1 Guest are viewing this topic.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9288
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
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 VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 843
  • #conligwx
    • conligwx.org
Re: Saratoga Base-World template switching from WU-forecast to DS-forecast
« Reply #1 on: December 02, 2018, 08:15:43 PM »
Thanks Ken for your hard work on this.

Updated my site and can confirm it is working.
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Online gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Saratoga Base-World template switching from WU-forecast to DS-forecast
« Reply #2 on: December 03, 2018, 08:05:35 AM »
Many thanks, Ken!  I've updated my site with the updated files, after suitable preservation of my version of Scott Thompson's ajax-dashboard6.php's differences.  Everything's still working fine with the WU forecast, but transitioning to the Dark-Sky forecast will be problematic insofar as there was no DarkSky-README.txt in the zip I downloaded.  Maybe attach it to this thread?

On another note, several weeks ago I noticed in my 'whos-online' script that there was a blizzard of Chinese sites loading my 'check-fetch-times.php' which they obviously tumbled to via my menu where I have referenced it as 'Version Control'.  Probably not the best idea since there's lots of information about my site there I don't want publicly available!

Since the cat was out of the bag I merely renamed my 'check-fetch-times.php' as a 'txt' file.  The link now gives a '404 Error, Not Found' until I go back with Filezilla and rename it as a 'php' script.  After running it, I rename it back to 'txt'.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Saratoga Base-World template switching from WU-forecast to DS-forecast
« Reply #3 on: December 03, 2018, 09:43:34 AM »
Jerry, HTH...

Quote
Version 1.00 - 02-Dec-2018 - initial release

Since WeatherUnderground has stopped issuing API keys in June, 2018 and plans to close the API December 31,2018, you MUST change
your Base-World site to use the new DarkSky forecast script (DS-forecast.php) for both new and old installations.
At the same time, updated versions of ajax-dashboard.php and wxforecast.php are required to complete the changeover from
WeatherUnderground to DarkSky forecasts for your Base-World site.

First, visit https://darksky.net/dev , sign in and acquire an API key to use DarkSky.net API.  Put the key value
in the $SITE['DSAPIkey'] variable as shown below.  Also acquire the Latitude/Longitude (in decimal numbers) and names
to include in the $SITE['DSforecasts'] array below.  The first entry will be the default forecast area and appear
on your site in the ajax-dashboard on the home page.  Change the units used if you like -- the default is
to use SI units (C,hPa,mm,km) with wind in km/h instead of m/s.

After changing those three items, edit your Settings.php file and ADD the following
near the bottom of the user configurable area:

// --- DarkSky.net forecast variables ---
$SITE['fcstscript'] = 'DS-forecast.php';
$SITE['fcstorg']    = 'DarkSky'; // set to 'DarkSky' for DarkSky.net

$SITE['DSAPIkey'] = 'specify-your-DarkSky-API-key-here'; // Your API key from https://darksky.net/dev

// DarkSky display Units:
// si: SI units (C,m/s,hPa,mm,km)
// ca: same as si, except that windSpeed and windGust are in kilometers per hour
// uk2: same as si, except that nearestStormDistance and visibility are in miles, and windSpeed and windGust in miles per hour
// us: Imperial units (F,mph,inHg,in,miles)

$SITE['DSshowUnitsAs'] = 'ca'; // ='us' for imperial, , ='si' for metric, ='ca' for canada, ='uk2' for UK
$SITE['DSforecasts'] = array(
 // Location|lat,long  (separated by | characters)
'Saratoga, CA, USA|37.27465,-122.02295',
'Auckland, NZ|-36.910,174.771', // Awhitu, Waiuku New Zealand
'Assen, NL|53.02277,6.59037',
'Blankenburg, DE|51.8089941,10.9080649',
'Carcassonne, FR|43.2077801,2.2790407',
'Braniewo, PL|54.3793635,19.7853585',
);
// --- end of DarkSky forecast variables ---

For more information on customization of the DS-forecast.php script, please see the documentation at
https://saratoga-weather.org/scripts-DSforecast.php

Ken True - webmaster at saratoga-weather.org - 02-Dec-2018
« Last Edit: December 03, 2018, 09:45:17 AM by jgillett »
John
W7JKG

Online gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Saratoga Base-World template switching from WU-forecast to DS-forecast
« Reply #4 on: December 03, 2018, 09:53:47 AM »
Thanks, John!  I'm not sure what happened to my download...

Edit:  Now I realize that I'm not using 'Base-World', so the Dark-Sky modifications are moot because I'm using the NWS forecasts in Base-USA. #-o
« Last Edit: December 03, 2018, 10:17:47 AM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline mldenison

  • Contributor
  • ***
  • Posts: 111
    • York, PA Weather
Re: Saratoga Base-World template switching from WU-forecast to DS-forecast
« Reply #5 on: December 03, 2018, 10:33:33 AM »
I'm a little dumber than most.  Mine's not working.

First, this is the only entry in my DSForecasts Array:

Code: [Select]
$SITE['DSforecasts'] = array(
 // Location|lat,long  (separated by | characters)
'York, PA, USA|39.962303,-76.727692',
);

I've got this array in my settings.php file.  The same array is in the DS-forecasts.php.  When I comment out the array in DS-forecasts.php, there's an error '500' on the screen.  It looks like the DarkSky variables I inserted into the settings.php aren't making it to the DS-forecasts.php.

Since my new DarkSky API key is in my settings.php file, that might explain why a forecast is not being returned.

I don't know what I messed up.

Here's my site: http://www.m82a1.us/index.php
Windows 7 x64
Weather PC: Intel NUC
Davis Vantage Pro 2
Weather Underground: KPAYORK30
York, PA Weather (Saratoga)
York, PA Weather (Leuven)
York, PA PWS Station

Online gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Saratoga Base-World template switching from WU-forecast to DS-forecast
« Reply #6 on: December 03, 2018, 10:36:09 AM »
I'm a little dumber than most.  Mine's not working.
Mine didn't work with Dark-Sky either.  See my post above as to why...
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline mldenison

  • Contributor
  • ***
  • Posts: 111
    • York, PA Weather
Re: Saratoga Base-World template switching from WU-forecast to DS-forecast
« Reply #7 on: December 03, 2018, 10:46:14 AM »
I see where Ken mentioned Base-World.  The implications of that were lost on me.  I guess I'll change my settings.php back to the original and wait for Ken to chime in about what to do.

Thanks
Windows 7 x64
Weather PC: Intel NUC
Davis Vantage Pro 2
Weather Underground: KPAYORK30
York, PA Weather (Saratoga)
York, PA Weather (Leuven)
York, PA PWS Station

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9288
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Saratoga Base-World template switching from WU-forecast to DS-forecast
« Reply #8 on: December 03, 2018, 10:51:59 AM »
To be clear, the DS-forecast.php script is only distributed in the Base-World distribution as it's intended to replace the WU-forecast.php script for non-USA, non-Canada use.  The Base-USA includes the NWS forecast script (advforecast2.php) for USA use only.  The Base-Canada includes the ec-forecast.php script for Canada use only.

While you can install the DarkSky forecast on any of the templates, it is most useful only on the Base-World set -- the other sets have far more functional forecast scripts included in the respective distributions.

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline zmarfak

  • Contributor
  • ***
  • Posts: 135
    • Matar
Re: Saratoga Base-World template switching from WU-forecast to DS-forecast
« Reply #9 on: December 04, 2018, 08:46:50 AM »
Thanks Ken,
excellent work as usual

Up and running
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a Intel NUC 
https://www.matar.be

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 843
  • #conligwx
    • conligwx.org
Re: Saratoga Base-World template switching from WU-forecast to DS-forecast
« Reply #10 on: December 04, 2018, 02:43:14 PM »
Updated to 1.04 all seems good!
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •