yr.no forecast

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

http://api.yr.no/weatherapi/locationforecast/1.9/?lat=60.1524&lon=24.9975 [b]api.yr.no[/b] [size=116][b]This site has been deprecated[/b][/size] 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
$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

$URLS = "https://api.met.no/weatherapi/locationforecast/1.9/?lat=$lat&lon=$lon";	// URL to the ENGLISH page on yr.no where location is
  1. 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

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