Author Topic: yr.no forecasts worldwide-script  (Read 30504 times)

0 Members and 1 Guest are viewing this topic.

Offline Lee10

  • Member
  • *
  • Posts: 20
Re: yr.no forecasts worldwide-script
« Reply #50 on: January 20, 2014, 06:17:29 PM »
Sorry for bringing this old thread but has anyobdy noticed that the drop down menus fail to work on this script or is it me?
Regards

Links are above

Offline Bunty

  • Forecaster
  • *****
  • Posts: 2429
  • Stillwater, home of Oklahoma State University
    • Welcome to Stillwater Weather
Re: yr.no forecasts worldwide-script
« Reply #51 on: January 20, 2014, 09:04:50 PM »
No, it works for me.  I still wish it could be set for imperial units.  But it works for the previous version, so I use it.

Also the 2nd home page using modified AltDashboard 6.95 at http://stillwaterweather.com/2ndhome.php

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: yr.no forecasts worldwide-script
« Reply #52 on: January 22, 2014, 05:41:49 AM »
Sorry for bringing this old thread but has anyobdy noticed that the drop down menus fail to work on this script or is it me?
Regards

Links are above
It would be helpfull to post an URL with your problem. I checked www.theweatheronline.net/yr/yrtest.php
The geonames databases got a new server.  You have to search in the yr_xmlII.php script for the line with
Code: [Select]
      url: "http://ws.geonames.org/searchJSON",and replace it with
Code: [Select]
     url: "http://api.geonames.org/searchJSON",succes, Wim

Offline Lee10

  • Member
  • *
  • Posts: 20
Re: yr.no forecasts worldwide-script
« Reply #53 on: January 22, 2014, 12:47:22 PM »
Thanks for your help

I have changed the above but still not working. The script works fine just the box won't drop down with options to change, a real mystery ](*,)

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: yr.no forecasts worldwide-script
« Reply #54 on: January 23, 2014, 02:48:21 AM »
Thanks for your help
I have changed the above but still not working. The script works fine just the box won't drop down with options to change, a real mystery ](*,)
So we have to solve that mistery ](*,) and break down the wall.
OK, step 1:
Just to make sure there are no unknown differences I tested your script with my city and compared that to the same city at my own test site:
http://www.theweatheronline.net/yr/yrtest.php?en|50.87959|4.70093|Europe/Brussels|Leuven|Belgium|BE
Exactly the same output as at my own test site but as you mentioned: No dropdown with city names at your site.
The javascript runs into errors as there are no names supplied by the geonames server.
step 2:
This is the request the yr.no script sends to the server to get the list of cities, nearly the same request as mine but with one small difference, the username.
http://api.geonames.org/searchJSON?callback=jQuery16405755373279098421_1390462282185&featureClass=P&style=full&maxRows=20&name_startsWith=le&country=BE&username=lee10&_=1390462289075
Step 3:
This is the answer of the geonames server, definitly not a list of cities as with my testsite.
Code: [Select]
jQuery16405755373279098421_1390462282185({"status":{"message":"user account not enabled to use the free webservice.
Please enable it on your account page: http://www.geonames.org/manageaccount ","value":10}});
Solution:
Go to http://www.geonames.org/manageaccount, enter your e-mail address/password and set a mark at the question about the webservices.

THEN it should work, definitly, I hope, it should  ;)

Wim

Offline Lee10

  • Member
  • *
  • Posts: 20
Re: yr.no forecasts worldwide-script
« Reply #55 on: January 23, 2014, 06:38:17 AM »
Bingo ;)

Thanks for your help seems it was not activated at the bottom must have changed the services they provide :?:

Offline GlosWeather

  • Senior Member
  • **
  • Posts: 73
    • Gloucestershire Weather
Re: yr.no forecasts worldwide-script
« Reply #56 on: January 23, 2014, 05:11:40 PM »
Hi Lee and Wim, I have tried to follow what you have written here, but for me it has not worked.
I have changed the geonames url in my feeder script to api.geonames as you have identified, but do not understand what I need to do after I log into the geonames website.
Could you let me (us) know what it was that you did on their website.
very many thanks
Steve

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: yr.no forecasts worldwide-script
« Reply #57 on: January 24, 2014, 04:33:14 AM »
Hi Lee and Wim, I have tried to follow what you have written here, but for me it has not worked.
I have changed the geonames url in my feeder script to api.geonames as you have identified, but do not understand what I need to do after I log into the geonames website.
Could you let me (us) know what it was that you did on their website.
very many thanks
Steve
Good morning,
It is not always the same error we are talking about. So it would be extremely helpfull if you supply an URL for the not working script. And preferably the test scripts which should work FIRST before adapting the scripts in other parts of your website.

The change from
Code: [Select]
url: "http://ws.geonames.org/searchJSON",
 to
url: "http://api.geonames.org/searchJSON",
has not be done at the only one of your production scripts I took a look at www.cotswold-weather.co.uk/fcast-gloucestershire.php
nor at your test-script http://www.cotswold-weather.co.uk/yr/yrtest.php

==== BUT ===
http://www.cotswold-weather.co.uk/yr/yrtest.php?en|50.87959|4.70093|Europe/Brussels|Leuven|Belgium|BE
works like a charm, if you forget about the cache errors.
The information is retrieved AND the dropdown box works.
That is because the geonames username is not changed from the default (test) name HENKKA uses to your username.
Code: [Select]
http://ws.geonames.org/searchJSON?callback=jQuery16406158764655701816_1390553420925&featureClass=P&style=full&maxRows=20&name_startsWith=br&country=BE&username=weatherc&_=1390553548426Putting your geonames username into the request returns the user account not enabled to use the free webservice. message.

==== Your question
Go to http://www.geonames.org/manageaccount, enter your e-mail address/password. There are 2 boxes on that page after you log in. The first one to change email adress. Second one to change password.
Below the second box there is a string Free Web Services with the current status. That text should read "the account xyz has been enabled for the free webservices on 2014-date time"
It is not showing that message for you. So you should place a checkmark there that you want to use the webservices.

Hope this helps,
Succes,  Wim

Offline Lee10

  • Member
  • *
  • Posts: 20
Re: yr.no forecasts worldwide-script
« Reply #58 on: January 25, 2014, 07:47:01 AM »
Hi Lee and Wim, I have tried to follow what you have written here, but for me it has not worked.
I have changed the geonames url in my feeder script to api.geonames as you have identified, but do not understand what I need to do after I log into the geonames website.
Could you let me (us) know what it was that you did on their website.
very many thanks
Steve

I had to log into the geonames account and re-activate the account at the very bottom. I also has to reset my password and then it worked, I hope this helps. Links are above

Offline GlosWeather

  • Senior Member
  • **
  • Posts: 73
    • Gloucestershire Weather
Re: yr.no forecasts worldwide-script
« Reply #59 on: January 25, 2014, 08:00:38 AM »
Many thanks to Lee and Wim for your help here. This was a tough one and without your assistance, I'm not sure if I would have coped with this change.
I now need to add the search facilities back to my forecasts scripts.
Thanks again
Steve

Offline Lee10

  • Member
  • *
  • Posts: 20
Re: yr.no forecasts worldwide-script
« Reply #60 on: June 21, 2014, 09:15:15 AM »
Sorry for bringing an old topic again but it seems this script has once again stopped working ](*,)

I have re-uploaded the script and changed the settings but no luck any help would be greatly helpful

http://www.theweatheronline.net/yr/yrtest.php

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: yr.no forecasts worldwide-script
« Reply #61 on: June 21, 2014, 10:49:03 AM »
Sorry for bringing an old topic again but it seems this script has once again stopped working ](*,)

I have re-uploaded the script and changed the settings but no luck any help would be greatly helpful

http://www.theweatheronline.net/yr/yrtest.php
There are three warnings running your script.
The second and third one are of no impartance.
The second one is because there is no cache folder at httpdocs (your root), so the downloaded information can not be saved.
The third one is that the chmod can not find the file just saved so it can not set the right permissions.
Those two errors only mean that the forecast is retrieved every time from YrNo and not saved to cache.
===
The important warning is the first one. 
It is a warning which only occurs when using HTTP
It is just a warning of no real importance but it breaks the script. And that warning only occurs at your site.

Using the same test scripts as last time, the scripts work without a hitch at my place. Also with your latitude and longitude settings lat=51.509&lon=-0.126.
No warnings such as yours.

So are there any changes in the past weeks such as
1. New version of PHP?
2. New webhosting company?
3. Using a proxy server to speed things up?

Wim

This is the w3org description of the "warning" responscode
Quote
203 Non-Authoritative Information
The returned metainformation in the entity-header is not the definitive set as available from the origin server, but is gathered from a local or a third-party copy. The set presented MAY be a subset or superset of the original version. For example, including local annotation information about the resource might result in a superset of the metainformation known by the origin server. Use of this response code is not required and is only appropriate when the response would otherwise be 200 (OK).

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
Re: yr.no forecasts worldwide-script
« Reply #62 on: June 21, 2014, 03:00:39 PM »
Hopefully one day this will work with Imperial units :D

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline Lee10

  • Member
  • *
  • Posts: 20
Re: yr.no forecasts worldwide-script
« Reply #63 on: June 21, 2014, 03:34:23 PM »
Sorry for bringing an old topic again but it seems this script has once again stopped working ](*,)

I have re-uploaded the script and changed the settings but no luck any help would be greatly helpful

http://www.theweatheronline.net/yr/yrtest.php
There are three warnings running your script.
The second and third one are of no impartance.
The second one is because there is no cache folder at httpdocs (your root), so the downloaded information can not be saved.
The third one is that the chmod can not find the file just saved so it can not set the right permissions.
Those two errors only mean that the forecast is retrieved every time from YrNo and not saved to cache.
===
The important warning is the first one. 
It is a warning which only occurs when using HTTP
It is just a warning of no real importance but it breaks the script. And that warning only occurs at your site.

Using the same test scripts as last time, the scripts work without a hitch at my place. Also with your latitude and longitude settings lat=51.509&lon=-0.126.
No warnings such as yours.

So are there any changes in the past weeks such as
1. New version of PHP?
2. New webhosting company?
3. Using a proxy server to speed things up?

Wim

This is the w3org description of the "warning" responscode
Quote
203 Non-Authoritative Information
The returned metainformation in the entity-header is not the definitive set as available from the origin server, but is gathered from a local or a third-party copy. The set presented MAY be a subset or superset of the original version. For example, including local annotation information about the resource might result in a superset of the metainformation known by the origin server. Use of this response code is not required and is only appropriate when the response would otherwise be 200 (OK).

Thanks for your help, just found the answer the version has updated from 1.8 to 1.9

From: http://api.yr.no/weatherapi/locationforecast/1.8/?lat=$lat&lon=$lon
To: http://api.yr.no/weatherapi/locationforecast/1.9/?lat=$lat&lon=$lon

Offline marko30

  • Member
  • *
  • Posts: 12
Re: yr.no forecasts worldwide-script
« Reply #64 on: September 28, 2020, 01:28:34 AM »
Has anyone noticed that script is not working anymore? Yr.no has done some updates to their website i think. I will give an eye in the afternoon.

Offline fifeweather

  • Member
  • *
  • Posts: 3
    • FifeWeather.co.uk
Re: yr.no forecasts worldwide-script
« Reply #65 on: November 02, 2020, 01:01:31 PM »
I'm still running a customised older version of the yr.no script here, and they are discontinuing the xml API early next year. So I need to update to something that will pull the WX data from the new V3 API available from api.met.no

I tried downloading the latest scripts from NordicWeather here, but that script appears to have been last updated in 2014 and I'm having a really hard time to get it to work. There are numerous issues including the code used to fetch the forecast is non-tls(so it doesn't work as it just fetches a HTTP 301 redirect to api.met.no's SSL site). But even after modifying the script to do a HTTPS pull of weather data via Curl (and confirming the script is getting healthy data from the API endpoint), I still can't get the script to work. :?

Does anybody have a working version of the script based on the new V3 API available from api.met.no that they would be willing to share?? I tried e-mailing NordicWeather.net but didn't get a reply.

Many thanks for any assistance!

Offline Lee10

  • Member
  • *
  • Posts: 20
Re: yr.no forecasts worldwide-script
« Reply #66 on: January 08, 2022, 10:58:22 AM »
I know this is an old topic but has anybody noticed yr.no has stopped working?

You use to get an hourly forecast which was pretty accurate and now nothing seems to work #-o

Offline fifeweather

  • Member
  • *
  • Posts: 3
    • FifeWeather.co.uk
Re: yr.no forecasts worldwide-script
« Reply #67 on: January 09, 2022, 04:58:22 AM »
I know this is an old topic but has anybody noticed yr.no has stopped working?

You use to get an hourly forecast which was pretty accurate and now nothing seems to work #-o

When you say it's stopped working, what exactly do you mean? The old yr.no XML forecast feeds went a while back and yr.no have also discontinued their old meteogram widgets. But there is a new version of the widgets available as per here (in SVG rather than PNG format):

https://developer.yr.no/doc/guides/deprecating-old-widgets/

I'm not a huge fan of the new ones, as the units are not customisable and the windspeed is given in m/s which means very little to most folk. Anyway, not sure if that was what you meant, but hope that helps anyway?

Offline Lee10

  • Member
  • *
  • Posts: 20
Re: yr.no forecasts worldwide-script
« Reply #68 on: January 09, 2022, 10:04:22 AM »
It was the old script where you could put your location in and it would give you an hourly forecast with the icons and temperature etc, so I think it was the .xml script

If it helps here is an old thread link:
https://www.wxforum.net/index.php?topic=13342.0

I don't know what I could use to replace this.
Regards

Offline fifeweather

  • Member
  • *
  • Posts: 3
    • FifeWeather.co.uk
Re: yr.no forecasts worldwide-script
« Reply #69 on: January 09, 2022, 11:50:11 AM »
It was the old script where you could put your location in and it would give you an hourly forecast with the icons and temperature etc, so I think it was the .xml script

If it helps here is an old thread link:
https://www.wxforum.net/index.php?topic=13342.0

I don't know what I could use to replace this.
Regards

Yep that was exactly the same challenge I had. Short answer is I'm not aware of any shared drop-in replacement. I ended up writing some python and re-hashing the PHP to use the new JSON forecast data provided by the new feed -> https://api.met.no/weatherapi/locationforecast/2.0/documentation

I think some folk may have had some success using the "classic" formatted XML data that can be fetched from the above API feed to cobble together a working script.

If my efforts weren't a total dogs breakfast I would put them online, but they were done in a rush and I'm not even a coder's left toe, so it works thanks to bubble-gum and sticky tape! :lol:

I'm sorry I couldn't be the bearer of better news!

Offline Lee10

  • Member
  • *
  • Posts: 20
Re: yr.no forecasts worldwide-script
« Reply #70 on: January 09, 2022, 12:00:41 PM »
The only answer I tried was to use iframes from the site but yr.no doesn't like it as it refuses to connect so another head against the wall  ](*,)

So I don't know what else to try as I'm not an expert or programmer of JSON. If yr.no had allowed to have access to hourly forecasts guess could create some kind of script but again a lot of had scratching #-o

Offline Lee10

  • Member
  • *
  • Posts: 20
Re: yr.no forecasts worldwide-script
« Reply #71 on: January 11, 2022, 08:45:24 AM »
Does anyone else have any ideas, if not no worries?

I would use another service but not sure which was to use are free or not. Lots out there but all are like hitting a brick wall  ](*,)

I do find Yr.no pretty accurate in there forecasting but even here you seem to get less now #-o

Offline Lee10

  • Member
  • *
  • Posts: 20
Re: yr.no forecasts worldwide-script
« Reply #72 on: January 04, 2024, 06:08:49 AM »
Such an old topic but does anyone have a updated script of yr.no?

Is there an update or another script that can be updated?

Thanks,

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: yr.no forecasts worldwide-script
« Reply #73 on: January 04, 2024, 06:48:54 AM »
Such an old topic but does anyone have a updated script of yr.no?

Is there an update or another script that can be updated?

Thanks,
Hi Lee10,

Yr.no always used met.no data but modified that  to adept it to the way their website needed it.
They also distributed their modified met.no data as yr.no data.

Last year they stopped their downloads and adviced users to use the met.no data directly.

For met.no data there are scripts available, the data contains hourly and 6 hour forecasts.

I still support the old-fashioned-looking Leuven-Forecast scripts , demo available at https://pwswd.be/wsfct4/

Wim

 

Offline Lee10

  • Member
  • *
  • Posts: 20
Re: yr.no forecasts worldwide-script
« Reply #74 on: January 04, 2024, 12:18:36 PM »
Many thanks for your reply.

Great work just that the script that was offered in the good olden days was really useful and accurate. It all included world towns and cities in multiple countries as I recalled.

I know you can use the site in an old iframe but even this even won't work now like it use to.

Not sure what else I could try as it was in PHP format but now is .json which is beyond me. ](*,)

Thanks anyways


 

anything