cloudy cloudy

Author Topic: yr.no forecast  (Read 541 times)

0 Members and 1 Guest are viewing this topic.

Offline pwilman

  • Posts: 570
  • Bath Spa, United Kingdom
  • OS/Browser:
  • Mac OS X 10.12.6
  • Chrome 67.0.3396.87
    • Bath Spa Weather
yr.no forecast
« on: June 20, 2018, 04:48:37 AM »
Hello,

I have noticed that mine (http://www.pauwilman.com/yrtest.php) and a few others forecasts based on yr.no have stopped working over the last few days. Does anyone know if yr.no have switched this service off or made some changes to the data?

Thanks so much

Paul
paulwilman73@gmail.com
http://www.paulwilman.com

Davis vantage pro2 with dFARS, solar sensor, USB logger
W10 Lenovo ultra book 8Gb RAM

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 794
  • Leuven Belgium CEST
  • OS/Browser:
  • Mac OS X 10.13.5
  • Chrome 67.0.3396.87
    • My private weatherstation
Re: yr.no forecast
« Reply #1 on: June 20, 2018, 07:04:11 AM »
Hello,

I have noticed that mine (http://www.pauwilman.com/yrtest.php) and a few others forecasts based on yr.no have stopped working over the last few days. Does anyone know if yr.no have switched this service off or made some changes to the data?

Thanks so much

Paul
There are no changes at yr.no for the api.   Most yrno scripts use two urls to get the data
http://www.yr.no/place/United_Kingdom/England/Bath/varsel.xml
http://www.yr.no/place/United_Kingdom/England/Bath/forecast_hour_by_hour.xml
Both links work with http and https, so that is not the problem either.
Both links return valid and current data.

===
But still, the invalid dates indicate that no data was retrieved.

So it seems this version of the script is far older and is using an older link to get the data.
Running this script (with my lattitude/longitude) returns the following message
Quote
http://api.yr.no/weatherapi/locationforecast/1.9/?lat=60.1524&lon=24.9975
api.yr.no
This site has been deprecated
This site/domain is no longer in use.
To access the MET Norway Weatherapi, please use https://api.met.no/.
I tested it and changing that link  indeed retrieves the needed data.

1. Modify script  yr_xmlII.php
   => Change line 129 (at least that is the line-number in a test-version I had access to) from http and api.yr.no
Code: [Select]
$URLS = "http://api.yr.no/weatherapi/locationforecast/1.9/?lat=$lat&lon=$lon"; // URL to the ENGLISH page on yr.no where location is
to https and api.met.no
Code: [Select]
$URLS = "https://api.met.no/weatherapi/locationforecast/1.9/?lat=$lat&lon=$lon"; // URL to the ENGLISH page on yr.no where location is2. Delete the cached empty forecast in the cache folder, you do not have to wait until the script find it is to old.
Probably it has a name such as 1057644860bc300c57b8ef75c97936ed.xml

Success, Wim


« Last Edit: June 20, 2018, 07:06:43 AM by wvdkuil »
Vantage VUE with a WLIP used for https://weer.sluispark.be/
Vantage VP2 with a USB logger/Meteobridge for https://www.weerstation-herent.be/

Offline pwilman

  • Posts: 570
  • Bath Spa, United Kingdom
  • OS/Browser:
  • Mac OS X 10.12.6
  • Chrome 67.0.3396.87
    • Bath Spa Weather
Re: yr.no forecast
« Reply #2 on: June 20, 2018, 04:51:54 PM »
Wim,

Thanks so much for your help. Its all fixed now. Looks like I implemented the script in 2014....is there a newer version now? If so do you know the link to the files?

Thanks again.

Paul
paulwilman73@gmail.com
http://www.paulwilman.com

Davis vantage pro2 with dFARS, solar sensor, USB logger
W10 Lenovo ultra book 8Gb RAM

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 794
  • Leuven Belgium CEST
  • OS/Browser:
  • Mac OS X 10.13.5
  • Chrome 67.0.3396.87
    • My private weatherstation
Re: yr.no forecast
« Reply #3 on: June 20, 2018, 07:00:31 PM »
Wim,

Thanks so much for your help. Its all fixed now. Looks like I implemented the script in 2014....is there a newer version now? If so do you know the link to the files?

Thanks again.

Paul
It is a good and clear script. And an old and wise man said: "if it ain't broke, don't fix it"

Wim
Vantage VUE with a WLIP used for https://weer.sluispark.be/
Vantage VP2 with a USB logger/Meteobridge for https://www.weerstation-herent.be/

 

cumulus