cloudy cloudy

Author Topic: Saratoga Ajax +WU  (Read 292 times)

0 Members and 1 Guest are viewing this topic.

Offline eb3bvb

  • Posts: 138
  • Torrelavega, Cantabria
  • OS/Browser:
  • Win NT 10.0
  • Firefox 63.0
    • meteotorrelavega
Saratoga Ajax +WU
« on: December 02, 2018, 09:44:38 AM »
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/

Offline saratogaWX

  • Global Moderator
  • Posts: 5,842
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 63.0
    • Saratoga Weather
Re: Saratoga Ajax +WU
« Reply #1 on: December 02, 2018, 03:20:14 PM »
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.
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline eb3bvb

  • Posts: 138
  • Torrelavega, Cantabria
  • OS/Browser:
  • Win NT 10.0
  • Firefox 63.0
    • meteotorrelavega
Re: Saratoga Ajax +WU
« Reply #2 on: December 02, 2018, 06:01:58 PM »
Thank you very much for the information

Offline saratogaWX

  • Global Moderator
  • Posts: 5,842
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 63.0
    • Saratoga Weather
Re: Saratoga Ajax +WU
« Reply #3 on: December 02, 2018, 10:11:11 PM »
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
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

Let me know how it works out for you.

Best regards,
Ken
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline eb3bvb

  • Posts: 138
  • Torrelavega, Cantabria
  • OS/Browser:
  • Win NT 10.0
  • Firefox 63.0
    • meteotorrelavega
Re: Saratoga Ajax +WU
« Reply #4 on: December 03, 2018, 09:00:57 AM »
Thank you very much, as soon as this installation is communicated to you
a greeting
Emilio

Offline saratogaWX

  • Global Moderator
  • Posts: 5,842
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 63.0
    • Saratoga Weather
Re: Saratoga Ajax +WU
« Reply #5 on: December 03, 2018, 03:57:44 PM »
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
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline NorCal Dan

  • Dan - KJ6RGX
  • Posts: 10,369
  • Davis Vue/Win10
  • Ocean Park, WA.
  • OS/Browser:
  • Mac OS X 10.10.5
  • Chrome 70.0.3538.110
    • Traveling RV Weather
Re: Saratoga Ajax +WU
« Reply #6 on: December 03, 2018, 07:33:46 PM »
Installed and appears to be working...maybe you could take a look Ken and let me know if I messed it up or not...

Offline saratogaWX

  • Global Moderator
  • Posts: 5,842
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 63.0
    • Saratoga Weather
Re: Saratoga Ajax +WU
« Reply #7 on: December 03, 2018, 10:24:14 PM »
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.
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline eb3bvb

  • Posts: 138
  • Torrelavega, Cantabria
  • OS/Browser:
  • Win NT 10.0
  • Firefox 63.0
    • meteotorrelavega
Re: Saratoga Ajax +WU
« Reply #8 on: December 04, 2018, 08:26:27 AM »
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
« Last Edit: December 04, 2018, 06:59:54 PM by eb3bvb »