cloudy cloudy

Author Topic: Saratoga Base-World templates switch to DarkSky forecast before WU API shutdown  (Read 1148 times)

0 Members and 1 Guest are viewing this topic.

Offline saratogaWX

  • Global Moderator
  • Posts: 5,904
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 64.0
    • Saratoga Weather
For all the Base-World template users, make sure you switch to using DarkSky for forecasts before the planned 15-Feb-2019 shutdown of the WeatherUnderground API (at which time your WU-forecast.php scripts will cease operation).

The easiest way to switch is to use the update tool page with a query of Base-World, Plugin-*, 02-Dec-2018 to get all the needed files.  Follow the instructions in the included Settings-DarkSky-README.txt file to change your Settings.php to add the DarkSky API key and forecast locations to your site.  The ajax-dashboard.php and wxforecast.php scripts have also been updated for DarkSky support.

If you're using the ajax-dashboard6.php, please see this post for details on what to modify.  I've also updated the legacy script page with 6.95a of Scott's alternative ajax-dashboard6.php script (just the one file was updated).

WU has revealed the future API replacement and said it would be free for low-volume PWS data submitters to use, but has not offered any API keys for the new API yet -- the new API is INCOMPATIBLE with the existing WU-forecast.php, so you'll have to change to DarkSky.net forecasts before they shut off the old API.  I'll try a rewrite of WU-forecast for the new API as soon as keys are available -- right now they're only talking about a 5 day forecast period (instead of the current 7 day forecast).  DarkSky provides a 7 day forecast, but only for 24hr periods (so only 7 icons).

I'll keep you posted about developments for the WU API replacement -- in the meantime, DO update your sites to use DarkSky forecasts NOW.

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,475
  • Davis Vue/Win10
  • Ocean Park, WA.
  • OS/Browser:
  • Mac OS X 10.10.5
  • Chrome 71.0.3578.98
    • Traveling RV Weather
So those of us running the USA base don't need to make any changes...yet...?

Offline saratogaWX

  • Global Moderator
  • Posts: 5,904
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 64.0
    • Saratoga Weather
Correct, Dan.  The Base-USA template uses advforecast2.php (either the older V4 or the 'beta' V5 script) which depends on the NWS for data.
Likewise, the Base-Canada template uses ec-forecast.php for forecast data from Environment Canada. 
No changes to DarkSky are needed for either USA or Canada users.

Only the Base-World template used WU-forecast.php and must switch to using DS-forecast.php for DarkSky before 15-Feb-2019 when the WU API is planned to be shutdown.  The same applies to any standalone user of WU-forecast (switch to DS-forecast.php).
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline eliv

  • Posts: 88
  • Israel
  • OS/Browser:
  • Win NT 10.0
  • Chrome 71.0.3578.98
Hi Ken
Thanks very much for the update.
After updating the files, I have some issues with the translations, first its LTR instead of RTL and some is translating to Hebrew and some are not.
I would appreciate it very much if you can have a look on it
http://evweather.info/wxforecast.php
Thanks
Eli

Offline saratogaWX

  • Global Moderator
  • Posts: 5,904
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 64.0
    • Saratoga Weather
Hi Eli,
It appears that despite the $lang='he' setting, the script is loading with lang=en so only the English shows for the forecast.  I had included Hebrew as a supported language in DS-forecast-lang.php ,  I'll have to do some local investigation and get back with you on this.  Thanks for spotting the problem.

BTW.. let me know if the Hebrew translations in the rest of the page display are working or not.. I can have you change the Hebrew translation table for me to make it correct :)

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

Offline saratogaWX

  • Global Moderator
  • Posts: 5,904
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • iOS 12.1.1
  • Safari 12.0
    • Saratoga Weather
Ahh.. found it in DS-forecast.php in a lookup array.  Find
Code: [Select]
'he' => 'en', and replace it with
Code: [Select]
'he' => 'he', then the rest of the text should be in Hebrew.  You need to add ?force=1 to the wxforecast.php url to force a cache refresh after the script change.

 #-o sorry for the script typo.
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline eliv

  • Posts: 88
  • Israel
  • OS/Browser:
  • Win NT 10.0
  • Chrome 71.0.3578.98
Hi Ken
Thanks, that solved the translation problem (so you can keep the table  :D), but still the page orientation is left to right instead of RTL (All other pages are ok)
« Last Edit: January 05, 2019, 08:30:03 AM by eliv »

Offline Svenni

  • Posts: 38
  • Moss in Norway
  • OS/Browser:
  • Win NT 10.0
  • Chrome 70.0.3538.102
    • Refsnesbakken Borettslag
Hi Ken

Thx for update, i have a question about the update time. its always show Updated: 05/01/2019 00:00, is there some thing i have forgot to do?

Svein Ove
Svenni


Offline saratogaWX

  • Global Moderator
  • Posts: 5,904
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 64.0
    • Saratoga Weather
Hi Ken
Thanks, that solved the translation problem (so you can keep the table  :D), but still the page orientation is left to right instead of RTL (All other pages are ok)
Hi Eli,
Since I don't read Hebrew, can you draw on the Hebrew image below and show what is not RTL as you expect?  I've included the English for the same forecast as a separate image.

Hi Ken

Thx for update, i have a question about the update time. its always show Updated: 05/01/2019 00:00, is there some thing i have forgot to do?

Svein Ove
Hi Svein,
DarkSky.net does not offer a 'forecast updated' time in their JSON (I have suggested it to them).  So, the timestamp for the first period forecast (which is always midnight local time) is used for the forecast updated time.. it's the only data they provide.
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline eliv

  • Posts: 88
  • Israel
  • OS/Browser:
  • Win NT 10.0
  • Chrome 71.0.3578.98
Hi
 
Hi Eli,
Since I don't read Hebrew, can you draw on the Hebrew image below and show what is not RTL as you expect?  I've included the English for the same forecast as a separate image.
 
Eventually you will :)

Its strange, your Hebrew page comes perfect, so I guess the problem is me. I have attached a pic with what I get, the days (bold) are on the left side and the script is aligned with it, it should be as in yours
« Last Edit: January 05, 2019, 05:05:10 PM by eliv »

Offline saratogaWX

  • Global Moderator
  • Posts: 5,904
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 64.0
    • Saratoga Weather
Eli,
I found the issue .. try using this version (1.06).
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline eliv

  • Posts: 88
  • Israel
  • OS/Browser:
  • Win NT 10.0
  • Chrome 71.0.3578.98
Thanks very much Ken , working perfectly

Offline saratogaWX

  • Global Moderator
  • Posts: 5,904
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 64.0
    • Saratoga Weather
Thanks for the problem spotting and testing the fix, Eli.  I've pushed the V1.06 to the Base-World distribution and standalone script page.
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline saratogaWX

  • Global Moderator
  • Posts: 5,904
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 64.0
    • Saratoga Weather
I've done an update to the DarkSky forecast script (DS-forecast.php V1.09, DS-forecast-lang.php V1.06) that adds a tabbed display of the Daily and Hourly(24hrs) forecasts.  Including scripts also need to add some CSS to format the tabbed display.

Standalone: https://saratoga-weather.org/scripts-DSforecast.php (the scripts and CSS addition are available there)

Template: https://saratoga-weather.org/wxtemplates/updates.php with query 23-Jan-2019, Base-World, Plugin-*
which updates DS-forecast.php, DS-forecast-lang.php and wxforecast.php scripts (the latter has the needed CSS included)
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline edje1205

  • edje
  • Posts: 1,959
  • Amsterdam Holland, the Netherlands
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Mozilla compatible
    • http://www.weersverwachtingen.eu


Thanks again for the good work !
Ed
Woodenshoes,mills,hightech;but random weather
www.weersverwachtingen.eu
P4 2,2Ghz-2GB RAM-Win7-Broadb.connect


 

cumulus