Saratoga Ajax +WU

Hello, I am using the Saratoga template, and it asks me:
Insert in Settings.php an entry for:

$ SITE [‘WUAPIkey’] = ‘your-key-here’;

replacing your-key-here with your WU API key.
WU no longer gives APIKEY, any solution for the ajaxdashboard.php
Thank you
the page is http://meteosierranevada.com/

I do have a replacement script (DS-forecast.php) to use DarkSky.net forecasts – it requires changes to ajax-dashboard.php, Settings.php, and wxforecast.php scripts… I’ll try to package up that for you later today.

Thank you very much for the information

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)

Thank you very much, as soon as this installation is communicated to you
a greeting
Emilio

Hi Emilio,

Your note prodded me to finish the update and release the scripts in the Base-World distribution. They’re now available via the update tool page with a query of 2-Dec-2018, Base-World, Plugin-*

Best regards,
Ken

Installed and appears to be working…maybe you could take a look Ken and let me know if I messed it up or not…

Hi Dan, It does appear to be working correctly. You can get a better forecast by using the NWS (advforecast2.php) on your USA site … just sayin’

The DS-forecast.php can be used on USA or Canada sites, but I suspect that the USA (advforecast2.php) or Canada (ec-forecast.php) from the respective NWS and EC will provide better results. DS-forecast.php is primarily intended for non-USA, non-Canada use as the only multilingual/international script to replace the WU-forecast.php script in the Saratoga World template set.

The check-fetch-times.php?show=versions won’t check for updates to DS-forecast.php in USA or Canada templates… only in World templates.

working correctly in
http: //www.meteosierranevada.es
thank you very much Ken

Now to change all the stations that I have used your template, which are quite