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

0 Members and 1 Guest are viewing this topic.

Offline Lee10

  • Member
  • *
  • Posts: 11
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

Online Bunty

  • Forecaster
  • *****
  • Posts: 1949
  • 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.81 at http://stillwaterweather.com/wx/2ndhome.php

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1243
    • Support site Leuven Template and scripts
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
Vantage VUE with a WLIP connected to a Meteobridge used for https://weer.sluispark.be/
Same VUE+WLIP uploads to WL.com(2.0)  used for https://sluispark.be/weather28/
Vantage VP2 with a USB logger/Meteobridge for https://www.weerstation-herent.be/
Envoy with a WLIP uploads to WL.com(1.0) as a backup / test for the same site.

Offline Lee10

  • Member
  • *
  • Posts: 11
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: 1243
    • Support site Leuven Template and scripts
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
Vantage VUE with a WLIP connected to a Meteobridge used for https://weer.sluispark.be/
Same VUE+WLIP uploads to WL.com(2.0)  used for https://sluispark.be/weather28/
Vantage VP2 with a USB logger/Meteobridge for https://www.weerstation-herent.be/
Envoy with a WLIP uploads to WL.com(1.0) as a backup / test for the same site.

Offline Lee10

  • Member
  • *
  • Posts: 11
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: 1243
    • Support site Leuven Template and scripts
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
Vantage VUE with a WLIP connected to a Meteobridge used for https://weer.sluispark.be/
Same VUE+WLIP uploads to WL.com(2.0)  used for https://sluispark.be/weather28/
Vantage VP2 with a USB logger/Meteobridge for https://www.weerstation-herent.be/
Envoy with a WLIP uploads to WL.com(1.0) as a backup / test for the same site.

Offline Lee10

  • Member
  • *
  • Posts: 11
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: 11
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: 1243
    • Support site Leuven Template and scripts
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).
Vantage VUE with a WLIP connected to a Meteobridge used for https://weer.sluispark.be/
Same VUE+WLIP uploads to WL.com(2.0)  used for https://sluispark.be/weather28/
Vantage VP2 with a USB logger/Meteobridge for https://www.weerstation-herent.be/
Envoy with a WLIP uploads to WL.com(1.0) as a backup / test for the same site.

Offline xcom

  • Forecaster
  • *****
  • Posts: 988
    • 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 Vue|Meteohub 5.0l (Build 7293) Running on Debian 7.9 x86 (oVirt)|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095

Offline Lee10

  • Member
  • *
  • Posts: 11
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

 

anything