Saratoga Ajax +WU

I’ve attached a .zip with the updates needed (updated ajax-dashboard.php, wxforecast.php and the current version of DS-forecast.php, DS-forecast-lang.php) and a README file which says

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 How Dark Sky users can use the Apple Weather app - Apple Support , 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 How Dark Sky users can use the Apple Weather app - Apple Support

// 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

Ken True - webmaster at saratoga-weather.org - 02-Dec-2018

Let me know how it works out for you.

Best regards,
Ken


Base-World-DarkSky-update.zip (41.8 KB)