WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Topic started by: weatherc on October 22, 2011, 04:21:55 AM

Title: yr.no forecasts worldwide-script
Post by: weatherc on October 22, 2011, 04:21:55 AM
Hi all!

Updated the yr.no-script so now its possible to search for 3.3 million forecasts in 240 countries :lol:

- Shows nearby webcams by Webcam travel
- Possibity to save favorite location
- It use geonames.org FREE webservice (Sign up required)
- If webserver have geotags like $_SERVER["HTTP_GEOIP_LONGITUDE"] it use that to get default location

Live demo: http://www.nordicweather.net/yrnoennuste.php?en
Download: http://www.nordicweather.net/downloads/?5

 :grin:

// Henkka
Title: Re: yr.no forecasts worldwide-script
Post by: CNYWeather on October 22, 2011, 08:25:05 AM
There's an error on your demo page Henka

Code: [Select]
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /var/www/vhosts/nordicweather.net/httpdocs/scripts/yr_xmlII.php on line 139
Title: Re: yr.no forecasts worldwide-script
Post by: weatherc on October 22, 2011, 11:10:48 AM
Quote
There's an error on your demo page Henka

I don't see the error here.
I *think* its the autolocator for the default forecast what use geoip what fail for some reason, shouldn't affect the usage of the search tought.

// Henkka
Title: Re: yr.no forecasts worldwide-script
Post by: CNYWeather on October 22, 2011, 11:27:49 AM
That demo page wont fill in anything on the auto select Henka

Title: Re: yr.no forecasts worldwide-script
Post by: weatherc on October 22, 2011, 12:21:39 PM
Works fine here. There are no "Utica, NY" hit in the database tought.
Just write say Uti and hits are as attached.

You can test also this one: http://www.nordicweather.net/test/yr/yrtest.php
It has predefined default as Helsinki like the zip has. That my version use the geoip Nginx/PHP-thingy for that.

Henkka
Title: Re: yr.no forecasts worldwide-script
Post by: CNYWeather on October 22, 2011, 12:28:55 PM
Getting there. A few issues.

I'm not able to display imperial units on anything except wind which is mph.

Temp and precip are C and MM

http://bit.ly/r0Ussc


Thank you!
Title: Re: yr.no forecasts worldwide-script
Post by: jay_hoehn on October 22, 2011, 03:16:44 PM
Tony and Henkka,

I am also trying out the script.  I also can't get it to change the temp to F and pressure to inHg.  I am also trying to change the date format to d.m.y and that doesn't work.  I also can't get the default location to set.

See it here: http://www.jayswoodfurniture.com/wx/worldfor/yrtest.php

Thanks,

Jay
Title: Re: yr.no forecasts worldwide-script
Post by: mava on October 23, 2011, 07:51:22 AM
Hi,
Almost there....

I have a problem getting the default place to show.
Works fine when I choose country and place. Its just the default place not working.

My settings :

// Timesettings, normal PHP/date-tags used
$datestyle = "d.m.Y";      // Style of short date
$timestyle = "H:i";      // Style of time
$longdate = "d.m.Y H:i";   // Style of long time + date
$deftz = "Europe/Oslo";
$pagename = "wxyr2.php";

$geonameusr = "mava2"; // IMPORTANT! You need to signup at geonames.org (FREE), put username here

// Cachesettings etc. settings
$qarefetchSeconds = 3600;   // How often it refresh the cache, 3600 recommended
$imgdir = "yr2/images/";   // Icons-folder
$jsfolder = "yr2/jquery/";
$cssfolder = "yr2/css/";
$cachefolder = "yr2/cache/";
$days = array('søndag','mandag','tirsdag','onsdag','torsdag','fredag','lørdag');

// Default place
$cod = "NO";
$cou = "Norway";
$cit = "%C3%85lg%C3%A5rd";  << Have tried to use  : Ålgård and Ã…lgÃ¥rd without any luck
$lat = 58.76417;
$lon = 5.85253;

http://www.mavahome.com/wxyr2.php

rgs
Title: Re: yr.no forecasts worldwide-script
Post by: Bunty on October 25, 2011, 01:53:11 AM
Getting there. A few issues.

I'm not able to display imperial units on anything except wind which is mph.

Temp and precip are C and MM

http://bit.ly/r0Ussc


Thank you!

I'm having the same problems.   Since it's, otherwise, impressive, I hope it gets fixed.
Title: Re: yr.no forecasts worldwide-script
Post by: i_fiorentino on October 29, 2011, 12:50:23 PM
Hi,
Almost there....

I have a problem getting the default place to show.
Works fine when I choose country and place. Its just the default place not working.

My settings :

// Timesettings, normal PHP/date-tags used
$datestyle = "d.m.Y";      // Style of short date
$timestyle = "H:i";      // Style of time
$longdate = "d.m.Y H:i";   // Style of long time + date
$deftz = "Europe/Rome";
$pagename = "yrtest.php";

$geonameusr = "i_fiorentino"; // IMPORTANT! You need to signup at geonames.org (FREE), put username here

// Cachesettings etc. settings
$qarefetchSeconds = 7200;   // How often it refresh the cache, 3600 recommended
$imgdir = "./images/";   // Icons-folder
$jsfolder = "./jquery/";
$cssfolder = "./css/";
$cachefolder = "./cache/";
$days = array('Domenica','Luned&igrave;','Marted&igrave;','Mercoled&igrave;','Gioved&igrave;','Venerd&igrave;','Sabato');

// Default place
$cod = "IT";
$cou = "Italy";
$cit = "Carmignano";
$lat = 43.80443;
$lon = 11.02722;

Same problem here: http://www.meteocarmignano.it/wxysforecast_test.php
No weather forecasts on my page with default place.
Possibile geotag issue? How does it work?

Thanks in advance,

Alessandro
Title: Re: yr.no forecasts worldwide-script
Post by: edje1205 on October 30, 2011, 12:20:36 PM
Hi Henkka

Another marvelous script  :grin:

Almost got it to work, but unfortunately no graphics and buttons at the page
http://www.weersverwachtingen.eu/clientraw/wd-ajax-ml/wxyrglobal.php?nl|52.392153883603726|4.943418502807617|Europe/Amsterdam|Nieuwendam|Netherlands|NL (http://www.weersverwachtingen.eu/clientraw/wd-ajax-ml/wxyrglobal.php?nl|52.392153883603726|4.943418502807617|Europe/Amsterdam|Nieuwendam|Netherlands|NL)

Is there any  root for the script ? think something went wrong in the paths
yr_xmlII.php and yrdb.php are at www.weersverwachtingen.eu/clientraw/wd-ajax-ml/scripts

settings as attached

maybe you can give me a clue ?

thnx so far
Title: Re: yr.no forecasts worldwide-script
Post by: edje1205 on October 31, 2011, 10:01:16 AM
Hi all,

Got it to work !  :grin:
with try and error, changing paths (1000x  :shock: #-o) etc etc
settings see att (FWIW)

Only my startpage has no place and country in it
http://www.weersverwachtingen.eu/clientraw/wd-ajax-ml/wxyrglobal2.php (http://www.weersverwachtingen.eu/clientraw/wd-ajax-ml/wxyrglobal2.php)

any suggestions ?

thnx for the script Henkka
Title: Re: yr.no forecasts worldwide-script
Post by: i_fiorentino on October 31, 2011, 10:23:20 AM
Hi Edje,
i've the same problem here: http://www.meteocarmignano.it/wxysforecast_test.php
The script doesn't find the default place.
Probably geoip issue?
Title: Re: yr.no forecasts worldwide-script
Post by: edje1205 on October 31, 2011, 11:56:25 AM

...or cookie yrfav-fi is not created !?

had a while the page as favorite ; then
set cache expire at 3600 and it was gone after an hour !

 :shock: :roll:

edit: cookie created only shows: settings style / widescreen on or off
Title: Re: yr.no forecasts worldwide-script
Post by: mickopla on December 16, 2011, 01:50:41 AM
Is there any step by step guide to get this script working as i have tried the last few days with no luck? I followed the README but its very limited. Here is what i have so far http://www.waterfordcityweather.com/yrtest.php Thanks in Advance

Mick
Title: Re: yr.no forecasts worldwide-script
Post by: mickopla on December 17, 2011, 10:19:39 PM
Got the script to work but default location is blank. Also i have no weather symbols to depict sunshine cloudy ext. So close to getting this working. Shame there is no real support forum for this.

www.waterfordcityweather.com/yrtest.php
Title: Re: yr.no forecasts worldwide-script
Post by: jgillett on December 18, 2011, 06:15:47 PM
Mostly the same problems as everybody else - date is backwards (d.m rather than m.d), units are Metric rather than Imperial, time is not local, favorite won't set, etc. Pressure shows inHg, but the data is actually hPa. Really enjoy your scripts, but this one won't budge no matter what I do to the config.

http://tiggrweather.net/yr/yrtest.php

Thanks.
Title: Re: yr.no forecasts worldwide-script
Post by: Bunty on December 19, 2011, 02:09:32 AM
I  guess it's still in beta.
Title: Re: yr.no forecasts worldwide-script
Post by: mickopla on December 19, 2011, 04:16:34 AM
Mostly the same problems as everybody else - date is backwards (d.m rather than m.d), units are Metric rather than Imperial, time is not local, favorite won't set, etc. Pressure shows inHg, but the data is actually hPa. Really enjoy your scripts, but this one won't budge no matter what I do to the config.

http://tiggrweather.net/yr/yrtest.php

Thanks.

You have the buttons and weather icons working which i can't manage do. I am putting the .png files provided in the images folder of my server but only the big numbers( which are in the same folder)are working. If i had the icons working i'd be happy enough to go live with it on my website. Any guidance on how you got the icons to work??
Cheers

Mick
Title: Re: yr.no forecasts worldwide-script
Post by: illice on December 19, 2011, 04:58:22 AM
Hello
Someone can help me, I can not work properly.

// Units
$useC = 1;      // Use Celsius, else F
$useKMH = 0;      // Use Km/h
$useMPH = 0;      // Use Mph, if both KMH and MPH is zero is default m/s used
$useHPA = 1;      // Use hPa, else inHg
$useMM= 1;      // Use mm, else in

// Timesettings, normal PHP/date-tags used
$datestyle = "d.m.Y";      // Style of short date
$timestyle = "H:i";      // Style of time
$longdate = "d.m.Y H:i";   // Style of long time + date
$deftz = "Europe/Madrid";
$pagename = "yrtest.php";

$geonameusr = "illice"; // IMPORTANT! You need to signup at geonames.org (FREE), put username here

// Cachesettings etc. settings
$qarefetchSeconds = 7200;   // How often it refresh the cache, 3600 recommended
$imgdir = "images/";   // Icons-folder
$jsfolder = "jquery/";
$cssfolder = "css/";
$cachefolder = "cache/";
$days = array('Sunnuntai','Maanantai','Tiistai','Keskiviikko','Torstai','Perjantai','Lauantai');

// Default place
$cod = "Es";
$cou = "Spain";
$cit = "Elche";
$lat = "38.26";
$lon = "-0.7";

http://www.meteoillice.es/yrtest.php

Thanks
Title: Re: yr.no forecasts worldwide-script
Post by: edje1205 on December 19, 2011, 05:02:59 AM


hi
send this pM to Mick:

I started in yr_xmlII.php with:

ini_set('display_errors', '1');

for cache/paths I have:

// Cachesettings etc. settings
$qarefetchSeconds = 3600;   // How often it refresh the cache, 3600 recommended
$imgdir = "images2/";   // Icons-folder
$jsfolder = "jquery/";
$cssfolder = "scripts/css/";
$cachefolder = "/var/www/vhosts/weersverwachtingen.eu/httpdocs/cache/";




....and here (around line 146 ) in yr_xmlII.php I filled in my station lat/lon

date_default_timezone_set($tz);
$qacacheName = $cachefolder.md5($lat.$lon).'.xml';
$URLS = "http://api.yr.no/weatherapi/locationforecast/1.8/?lat=52.4385368327251&lon=4.8264312744140625";   // URL to the ENGLISH page on yr.no where location is

were the lat/lon is my station so find out

hope this helps
Title: Re: yr.no forecasts worldwide-script
Post by: mickopla on December 19, 2011, 06:52:41 AM


hi
send this pM to Mick:

I started in yr_xmlII.php with:

ini_set('display_errors', '1');

for cache/paths I have:

// Cachesettings etc. settings
$qarefetchSeconds = 3600;   // How often it refresh the cache, 3600 recommended
$imgdir = "images2/";   // Icons-folder
$jsfolder = "jquery/";
$cssfolder = "scripts/css/";
$cachefolder = "/var/www/vhosts/weersverwachtingen.eu/httpdocs/cache/";




....and here (around line 146 ) in yr_xmlII.php I filled in my station lat/lon

date_default_timezone_set($tz);
$qacacheName = $cachefolder.md5($lat.$lon).'.xml';
$URLS = "http://api.yr.no/weatherapi/locationforecast/1.8/?lat=52.4385368327251&lon=4.8264312744140625";   // URL to the ENGLISH page on yr.no where location is

were the lat/lon is my station so find out

hope this helps

Cheers for the reply. I was checking on your website again and discovered that no matter what location is entered the forecast details are the same. I think this is happening because you entered the lat and lon on line 146.
One thing is puzzling me. In the images folder i have the bignums subfolder and 6 .png files. The icons are images contained in the png files. How can these be extracted? Do i need to create the icons in .gif form? Thanks again

Mick
Title: Re: yr.no forecasts worldwide-script
Post by: jgillett on December 19, 2011, 10:43:03 AM
You have the buttons and weather icons working which i can't manage do. I am putting the .png files provided in the images folder of my server...

Since you moved the images to a different location than they originally came in (in the .zip), you've probably got a path problem. I just uploaded the entire /yr/ folder and had no problems at all, since the path provided in the script is looking for /images/ to be within /yr/.
Title: Re: yr.no forecasts worldwide-script
Post by: mickopla on December 19, 2011, 11:37:13 AM
You have the buttons and weather icons working which i can't manage do. I am putting the .png files provided in the images folder of my server...

Since you moved the images to a different location than they originally came in (in the .zip), you've probably got a path problem. I just uploaded the entire /yr/ folder and had no problems at all, since the path provided in the script is looking for /images/ to be within /yr/.

That fixed the problem, Thanks so much  :grin:

Mick
Title: Re: yr.no forecasts worldwide-script
Post by: jgillett on December 19, 2011, 11:09:50 PM
That fixed the problem, Thanks so much  :grin:

My pleasure.
Title: Re: yr.no forecasts worldwide-script
Post by: mickopla on December 20, 2011, 12:01:21 AM
I have the script working but want to embed it in my website with a yowindow above. I tried a few things with no luck. Whats the best way to include it in a website php ? Here is what i have so far www.waterfordcityweather.com/yr/yrtest.php

Mick
Title: Re: yr.no forecasts worldwide-script
Post by: i_fiorentino on December 21, 2011, 04:53:27 PM


hi
send this pM to Mick:

I started in yr_xmlII.php with:

ini_set('display_errors', '1');

for cache/paths I have:

// Cachesettings etc. settings
$qarefetchSeconds = 3600;   // How often it refresh the cache, 3600 recommended
$imgdir = "images2/";   // Icons-folder
$jsfolder = "jquery/";
$cssfolder = "scripts/css/";
$cachefolder = "/var/www/vhosts/weersverwachtingen.eu/httpdocs/cache/";




....and here (around line 146 ) in yr_xmlII.php I filled in my station lat/lon

date_default_timezone_set($tz);
$qacacheName = $cachefolder.md5($lat.$lon).'.xml';
$URLS = "http://api.yr.no/weatherapi/locationforecast/1.8/?lat=52.4385368327251&lon=4.8264312744140625";   // URL to the ENGLISH page on yr.no where location is

were the lat/lon is my station so find out

hope this helps

Hi guys,
i've set it like Ed too but some problems persist.
City doesn't still show but ony lat and long.
The nearby webcam below the page doesn't show anymore.
Geoip doesn't work.
Link: http://www.meteocarmignano.it/wxysforecast.php

Any ideas?
Regards,
Alessandro
Title: Re: yr.no forecasts worldwide-script
Post by: mickopla on December 22, 2011, 10:24:26 AM


hi
send this pM to Mick:

I started in yr_xmlII.php with:

ini_set('display_errors', '1');

for cache/paths I have:

// Cachesettings etc. settings
$qarefetchSeconds = 3600;   // How often it refresh the cache, 3600 recommended
$imgdir = "images2/";   // Icons-folder
$jsfolder = "jquery/";
$cssfolder = "scripts/css/";
$cachefolder = "/var/www/vhosts/weersverwachtingen.eu/httpdocs/cache/";




....and here (around line 146 ) in yr_xmlII.php I filled in my station lat/lon

date_default_timezone_set($tz);
$qacacheName = $cachefolder.md5($lat.$lon).'.xml';
$URLS = "http://api.yr.no/weatherapi/locationforecast/1.8/?lat=52.4385368327251&lon=4.8264312744140625";   // URL to the ENGLISH page on yr.no where location is

were the lat/lon is my station so find out

hope this helps

Hi guys,
i've set it like Ed too but some problems persist.
City doesn't still show but ony lat and long.
The nearby webcam below the page doesn't show anymore.
Geoip doesn't work.
Link: http://www.meteocarmignano.it/wxysforecast.php

Any ideas?
Regards,
Alessandro

Any chance you could post the code you used for your wxysforecast.php. I want to put my yowindow and forecast script on the one page like yours. Cheers

Mick
Title: Re: yr.no forecasts worldwide-script
Post by: jompa68 on March 05, 2012, 04:48:12 AM
Hello,

i get alot of errors if i run default settings in yr_xmlII.php. i only change to have my location as default but it will not appear in front page.

Code: [Select]

// Units
$useC = 1; // Use Celsius, else F
$useKMH = 0; // Use Km/h
$useMPH = 0; // Use Mph, if both KMH and MPH is zero is default m/s used
$useHPA = 1; // Use hPa, else inHg
$useMM= 1; // Use mm, else in

// Timesettings, normal PHP/date-tags used
$datestyle = "d.m.Y"; // Style of short date
$timestyle = "H:i"; // Style of time
$longdate = "d.m.Y H:i"; // Style of long time + date
$deftz = "Europe/Stockholm";
$pagename = "yrtest.php";

$geonameusr = "hofors"; // IMPORTANT! You need to signup at geonames.org (FREE), put username here

// Cachesettings etc. settings
$qarefetchSeconds = 3600; // How often it refresh the cache, 3600 recommended
$imgdir = "images/"; // Icons-folder
$jsfolder = "jquery/";
$cssfolder = "css/";
$cachefolder = "cache/";
$days = array('Sunnuntai','Maanantai','Tiistai','Keskiviikko','Torstai','Perjantai','Lauantai');

// Default place
$cod = "SE";
$cou = "Sweden";
$cit = "Hofors";
$lat = 60.5457;
$lon = 16.2866;


http://www.xn--hoforsvdret-r8a.se/yr/yrtest.php (http://www.xn--hoforsvdret-r8a.se/yr/yrtest.php)

What have i miss?
Title: Re: yr.no forecasts worldwide-script
Post by: mickopla on March 09, 2012, 01:40:40 PM
Hello,

i get alot of errors if i run default settings in yr_xmlII.php. i only change to have my location as default but it will not appear in front page.

Code: [Select]

// Units
$useC = 1; // Use Celsius, else F
$useKMH = 0; // Use Km/h
$useMPH = 0; // Use Mph, if both KMH and MPH is zero is default m/s used
$useHPA = 1; // Use hPa, else inHg
$useMM= 1; // Use mm, else in

// Timesettings, normal PHP/date-tags used
$datestyle = "d.m.Y"; // Style of short date
$timestyle = "H:i"; // Style of time
$longdate = "d.m.Y H:i"; // Style of long time + date
$deftz = "Europe/Stockholm";
$pagename = "yrtest.php";

$geonameusr = "hofors"; // IMPORTANT! You need to signup at geonames.org (FREE), put username here

// Cachesettings etc. settings
$qarefetchSeconds = 3600; // How often it refresh the cache, 3600 recommended
$imgdir = "images/"; // Icons-folder
$jsfolder = "jquery/";
$cssfolder = "css/";
$cachefolder = "cache/";
$days = array('Sunnuntai','Maanantai','Tiistai','Keskiviikko','Torstai','Perjantai','Lauantai');

// Default place
$cod = "SE";
$cou = "Sweden";
$cit = "Hofors";
$lat = 60.5457;
$lon = 16.2866;


http://www.xn--hoforsvdret-r8a.se/yr/yrtest.php (http://www.xn--hoforsvdret-r8a.se/yr/yrtest.php)

What have i miss?

I've been trying for months to find a solution to the same problem with no luck. Its a shame as it would be a great script if it worked properly.
Title: Re: yr.no forecasts worldwide-script
Post by: i_fiorentino on March 10, 2012, 05:20:45 PM
Hi guys,
If you choose another city from menu the forecast seems to remain the same!  :-(
It remains also the impossibility to choose default city from menu....
Does it happen to you too?
Link: http://www.meteocarmignano.it/wxysforecast.php

Regards,

Alessandro
Title: Re: yr.no forecasts worldwide-script
Post by: mickopla on March 11, 2012, 02:20:34 PM
Hi guys,
If you choose another city from menu the forecast seems to remain the same!  :-(
It remains also the impossibility to choose default city from menu....
Does it happen to you too?
Link: http://www.meteocarmignano.it/wxysforecast.php

Regards,

Alessandro

My forecasts do change when the city does but won't load a default place on start. http://www.waterfordcityweather.com/yr/yrtest.php
Title: Re: yr.no forecasts worldwide-script
Post by: i_fiorentino on March 11, 2012, 05:08:03 PM
Hi guys,
If you choose another city from menu the forecast seems to remain the same!  :-(
It remains also the impossibility to choose default city from menu....
Does it happen to you too?
Link: http://www.meteocarmignano.it/wxysforecast.php

Regards,

Alessandro

My forecasts do change when the city does but won't load a default place on start. http://www.waterfordcityweather.com/yr/yrtest.php

Yes,
because i've set this code:
Code: [Select]
$URLS = "http://api.yr.no/weatherapi/locationforecast/1.8/?lat=43.8000&lon=11.0333"; // URL to the ENGLISH page on yr.no where location is

with my coordinates....the script goes directly on my place but if i choose other cities it shows the same forecast.
Your issue it's a known issue......i hope that Henkka fix it soon as possible!
Regards,

Alessandro
Title: Re: yr.no forecasts worldwide-script
Post by: jacg on March 12, 2012, 12:32:08 PM
Solution:

Change the lines between 85 - 130 by these:

Code: [Select]
// CONFIG END
//**********************************************
$q = $_SERVER["QUERY_STRING"];
if ($q != "") {;
$q = explode("|",$q);
$lat = $q[1];
$lon = $q[2];
$tz = $q[3];
$cit = $q[4];
$cou = $q[5];
$cod = $q[6];
//$g = utf8_decode(urldecode($g));
//$gs = explode('/',$g);
//$g = str_replace("/","",strstr($g, '/'));

$mc = parse_url($_SERVER['HTTP_REFERER']);
$MH = $mc['host'];
}


if(isset($_COOKIE["yrfav-fi"]) && !is_numeric($lat)){
$q = explode("|",$_COOKIE["yrfav-fi"]);
$lat = $q[0];
$lon = $q[1];
$cit = $q[2];
$cou = $q[3];
$cod = $q[4];
$frcid = $lat.'|'.$lon.'|'.$cit.'|'.$cou.'|'.$cod;
}
elseif(!is_numeric($lat)&&isset($_SERVER["HTTP_GEOIP_LATITUDE"])){
$cod = $_SERVER["HTTP_GEOIP_CITY_COUNTRY_CODE"];
$cou = $_SERVER["HTTP_GEOIP_CITY_COUNTRY_NAME"];
$cit = $_SERVER["HTTP_GEOIP_CITY"];
$lat = $_SERVER["HTTP_GEOIP_LATITUDE"];
$lon = $_SERVER["HTTP_GEOIP_LONGITUDE"];
$frcid = $lat.'|'.$lon.'|'.$cit.'|'.$cou.'|'.$cod;
}
elseif(is_numeric($lat)){$frcid = $lat.'|'.$lon.'|'.$cit.'|'.$cou.'|'.$cod;}
else{$frcid = $lat.'|'.$lon.'|'.$cit.'|'.$cou.'|'.$cod;}

date_default_timezone_set($tz);
$qacacheName = $cachefolder.md5($lat.$lon).'.xml';
$URLS = "http://api.yr.no/weatherapi/locationforecast/1.8/?lat=$lat&lon=$lon"; // URL to the ENGLISH page on yr.no where location is


// refresh cached copy of page if needed
// fetch/cache code by Tom at carterlake.org

And everything should work  ;)

Jacco
Title: Re: yr.no forecasts worldwide-script
Post by: katakomba on March 12, 2012, 05:44:36 PM
well nice script but i found significant differences between real altitude and api 1.8 model altitude
Title: Re: yr.no forecasts worldwide-script
Post by: mickopla on March 12, 2012, 06:12:20 PM
Solution:

Change the lines between 85 - 130 by these:

Code: [Select]
// CONFIG END
//**********************************************
$q = $_SERVER["QUERY_STRING"];
if ($q != "") {;
$q = explode("|",$q);
$lat = $q[1];
$lon = $q[2];
$tz = $q[3];
$cit = $q[4];
$cou = $q[5];
$cod = $q[6];
//$g = utf8_decode(urldecode($g));
//$gs = explode('/',$g);
//$g = str_replace("/","",strstr($g, '/'));

$mc = parse_url($_SERVER['HTTP_REFERER']);
$MH = $mc['host'];
}


if(isset($_COOKIE["yrfav-fi"]) && !is_numeric($lat)){
$q = explode("|",$_COOKIE["yrfav-fi"]);
$lat = $q[0];
$lon = $q[1];
$cit = $q[2];
$cou = $q[3];
$cod = $q[4];
$frcid = $lat.'|'.$lon.'|'.$cit.'|'.$cou.'|'.$cod;
}
elseif(!is_numeric($lat)&&isset($_SERVER["HTTP_GEOIP_LATITUDE"])){
$cod = $_SERVER["HTTP_GEOIP_CITY_COUNTRY_CODE"];
$cou = $_SERVER["HTTP_GEOIP_CITY_COUNTRY_NAME"];
$cit = $_SERVER["HTTP_GEOIP_CITY"];
$lat = $_SERVER["HTTP_GEOIP_LATITUDE"];
$lon = $_SERVER["HTTP_GEOIP_LONGITUDE"];
$frcid = $lat.'|'.$lon.'|'.$cit.'|'.$cou.'|'.$cod;
}
elseif(is_numeric($lat)){$frcid = $lat.'|'.$lon.'|'.$cit.'|'.$cou.'|'.$cod;}
else{$frcid = $lat.'|'.$lon.'|'.$cit.'|'.$cou.'|'.$cod;}

date_default_timezone_set($tz);
$qacacheName = $cachefolder.md5($lat.$lon).'.xml';
$URLS = "http://api.yr.no/weatherapi/locationforecast/1.8/?lat=$lat&lon=$lon"; // URL to the ENGLISH page on yr.no where location is


// refresh cached copy of page if needed
// fetch/cache code by Tom at carterlake.org

And everything should work  ;)

Jacco

Well done Sir. Followed your instructions and now the script is working perfectly  =D&gt;

Now to include it on my website within menus and alike.
Title: Re: yr.no forecasts worldwide-script
Post by: Bunty on March 14, 2012, 12:48:01 AM
Mine is working okay, except I can't adjust units of measurement to imperial, except for wind, which is able to be set to mph.  Also month and day are in reverse order from the way I have them set.
http://stillwaterweather.com/yrtest.php (http://stillwaterweather.com/yrtest.php)
Title: Re: yr.no forecasts worldwide-script
Post by: i_fiorentino on March 15, 2012, 07:26:28 PM
Solution:

Change the lines between 85 - 130 by these:

Code: [Select]
// CONFIG END
//**********************************************
$q = $_SERVER["QUERY_STRING"];
if ($q != "") {;
$q = explode("|",$q);
$lat = $q[1];
$lon = $q[2];
$tz = $q[3];
$cit = $q[4];
$cou = $q[5];
$cod = $q[6];
//$g = utf8_decode(urldecode($g));
//$gs = explode('/',$g);
//$g = str_replace("/","",strstr($g, '/'));

$mc = parse_url($_SERVER['HTTP_REFERER']);
$MH = $mc['host'];
}


if(isset($_COOKIE["yrfav-fi"]) && !is_numeric($lat)){
$q = explode("|",$_COOKIE["yrfav-fi"]);
$lat = $q[0];
$lon = $q[1];
$cit = $q[2];
$cou = $q[3];
$cod = $q[4];
$frcid = $lat.'|'.$lon.'|'.$cit.'|'.$cou.'|'.$cod;
}
elseif(!is_numeric($lat)&&isset($_SERVER["HTTP_GEOIP_LATITUDE"])){
$cod = $_SERVER["HTTP_GEOIP_CITY_COUNTRY_CODE"];
$cou = $_SERVER["HTTP_GEOIP_CITY_COUNTRY_NAME"];
$cit = $_SERVER["HTTP_GEOIP_CITY"];
$lat = $_SERVER["HTTP_GEOIP_LATITUDE"];
$lon = $_SERVER["HTTP_GEOIP_LONGITUDE"];
$frcid = $lat.'|'.$lon.'|'.$cit.'|'.$cou.'|'.$cod;
}
elseif(is_numeric($lat)){$frcid = $lat.'|'.$lon.'|'.$cit.'|'.$cou.'|'.$cod;}
else{$frcid = $lat.'|'.$lon.'|'.$cit.'|'.$cou.'|'.$cod;}

date_default_timezone_set($tz);
$qacacheName = $cachefolder.md5($lat.$lon).'.xml';
$URLS = "http://api.yr.no/weatherapi/locationforecast/1.8/?lat=$lat&lon=$lon"; // URL to the ENGLISH page on yr.no where location is


// refresh cached copy of page if needed
// fetch/cache code by Tom at carterlake.org

And everything should work  ;)

Jacco

Very nice Jacco!
Thank you very much,

Alessandro
Title: Re: yr.no forecasts worldwide-script
Post by: mickopla on March 16, 2012, 10:57:22 AM
Solution:

Change the lines between 85 - 130 by these:

Code: [Select]
// CONFIG END
//**********************************************
$q = $_SERVER["QUERY_STRING"];
if ($q != "") {;
$q = explode("|",$q);
$lat = $q[1];
$lon = $q[2];
$tz = $q[3];
$cit = $q[4];
$cou = $q[5];
$cod = $q[6];
//$g = utf8_decode(urldecode($g));
//$gs = explode('/',$g);
//$g = str_replace("/","",strstr($g, '/'));

$mc = parse_url($_SERVER['HTTP_REFERER']);
$MH = $mc['host'];
}


if(isset($_COOKIE["yrfav-fi"]) && !is_numeric($lat)){
$q = explode("|",$_COOKIE["yrfav-fi"]);
$lat = $q[0];
$lon = $q[1];
$cit = $q[2];
$cou = $q[3];
$cod = $q[4];
$frcid = $lat.'|'.$lon.'|'.$cit.'|'.$cou.'|'.$cod;
}
elseif(!is_numeric($lat)&&isset($_SERVER["HTTP_GEOIP_LATITUDE"])){
$cod = $_SERVER["HTTP_GEOIP_CITY_COUNTRY_CODE"];
$cou = $_SERVER["HTTP_GEOIP_CITY_COUNTRY_NAME"];
$cit = $_SERVER["HTTP_GEOIP_CITY"];
$lat = $_SERVER["HTTP_GEOIP_LATITUDE"];
$lon = $_SERVER["HTTP_GEOIP_LONGITUDE"];
$frcid = $lat.'|'.$lon.'|'.$cit.'|'.$cou.'|'.$cod;
}
elseif(is_numeric($lat)){$frcid = $lat.'|'.$lon.'|'.$cit.'|'.$cou.'|'.$cod;}
else{$frcid = $lat.'|'.$lon.'|'.$cit.'|'.$cou.'|'.$cod;}

date_default_timezone_set($tz);
$qacacheName = $cachefolder.md5($lat.$lon).'.xml';
$URLS = "http://api.yr.no/weatherapi/locationforecast/1.8/?lat=$lat&lon=$lon"; // URL to the ENGLISH page on yr.no where location is


// refresh cached copy of page if needed
// fetch/cache code by Tom at carterlake.org

And everything should work  ;)

Jacco

Very nice Jacco!
Thank you very much,

Alessandro

Hi Alessandro

I see you have the script included with your menus. What code are you using for your wxysforecast.php??? I want to have the script looking like yours.

Cheers

Mike
Title: Re: yr.no forecasts worldwide-script
Post by: mava on March 19, 2012, 02:45:49 PM
Hi,
I have the script working now.  :grin:
But I can't figure out how to display only 3 cameras instead of 4.
3 cameras would fit perfectly to the Saratoga template.
Any suggestions?

http://www.mavahome.com/wxyr2.php

Thanks
Title: Re: yr.no forecasts worldwide-script
Post by: mickopla on March 19, 2012, 06:54:07 PM
Hi,
I have the script working now.  :grin:
But I can't figure out how to display only 3 cameras instead of 4.
3 cameras would fit perfectly to the Saratoga template.
Any suggestions?

http://www.mavahome.com/wxyr2.php

Thanks

Not an answer to your questions but i was wondering what code are you using for your wxyr2.php script? I want my page looking like yours within the saratoga template. Thanks in advance

Mike
Title: Re: yr.no forecasts worldwide-script
Post by: mava on March 20, 2012, 03:49:56 AM
Hi,
Copied this to a new page. Also changed the paths in yr_xmlII.php since wxyr2 is in root.

<div id="main-copy">
     
<script>
<!--
if(!!!document.createElement('canvas').getContext) {
document.write('<script src="http://cdn.nordicweather.net/excanvas.min.js"></scr' + 'ipt>');
}
//-->   
</script>
<?php
include 'yr2/scripts/yr_xmlII.php';
echo $yrhead;
?>
</head>
<body>
<div style="width:650px";>
<h3>&nbsp;&nbsp;yr.no V2</h3>
<br/>
<?php
echo $yrtable;
?>


</div><!-- end main-copy -->
Title: Re: yr.no forecasts worldwide-script
Post by: mickopla on March 20, 2012, 10:26:53 AM
Hi,
Copied this to a new page. Also changed the paths in yr_xmlII.php since wxyr2 is in root.

<div id="main-copy">
     
<script>
<!--
if(!!!document.createElement('canvas').getContext) {
document.write('<script src="http://cdn.nordicweather.net/excanvas.min.js"></scr' + 'ipt>');
}
//-->   
</script>
<?php
include 'yr2/scripts/yr_xmlII.php';
echo $yrhead;
?>
</head>
<body>
<div style="width:650px";>
<h3>&nbsp;&nbsp;yr.no V2</h3>
<br/>
<?php
echo $yrtable;
?>


</div><!-- end main-copy -->


I tried the code above which works to a certain extent but i have no table or conditions icons. You can view it here www.waterfordcityweather.com/wxnewpage.php

Any ideas on how to get the icons and table to work. They are working fine for me here www.waterfordcityweather.com/yr/yrtest.php


Mike
Title: Re: yr.no forecasts worldwide-script
Post by: Torjan on March 20, 2012, 03:13:30 PM
Hi,
I have the script working now.  :grin:
But I can't figure out how to display only 3 cameras instead of 4.
3 cameras would fit perfectly to the Saratoga template.
Any suggestions?

http://www.mavahome.com/wxyr2.php

Thanks

Hi!
Tray this in yr.css

.jcarousel-skin-ie7 .jcarousel-container-horizontal {width: 610px;height: 140px;padding: 20px 20px 20px 20px;}
.jcarousel-skin-ie7 .jcarousel-container-vertical {width: 610px;height: 245px;padding: 40px 20px;}
.jcarousel-skin-ie7 .jcarousel-clip-horizontal {width: 590px;height: 160px;}

Torjan
Title: Re: yr.no forecasts worldwide-script
Post by: mava on March 20, 2012, 06:12:37 PM
Takker Torjan  :grin:
Title: Re: yr.no forecasts worldwide-script
Post by: jgillett on March 20, 2012, 10:03:38 PM
Still have the following problems, mentioned by others earlier but not answered that I have found...

1. Date and time formats are not following what I have set in config.

2. Graph shows mm, C, and hPa, rather than what I have set.

3. Table shows temp in C, pressure as 1016.2 inHg (!), and incorrect date and time formats.

http://tiggrweather.net/yr/yrtest.php

Thanks.
Title: Re: yr.no forecasts worldwide-script
Post by: mickopla on March 21, 2012, 11:17:41 AM
Hi,
Copied this to a new page. Also changed the paths in yr_xmlII.php since wxyr2 is in root.

<div id="main-copy">
     
<script>
<!--
if(!!!document.createElement('canvas').getContext) {
document.write('<script src="http://cdn.nordicweather.net/excanvas.min.js"></scr' + 'ipt>');
}
//-->   
</script>
<?php
include 'yr2/scripts/yr_xmlII.php';
echo $yrhead;
?>
</head>
<body>
<div style="width:650px";>
<h3>&nbsp;&nbsp;yr.no V2</h3>
<br/>
<?php
echo $yrtable;
?>


</div><!-- end main-copy -->


I tried the code above which works to a certain extent but i have no table or conditions icons. You can view it here www.waterfordcityweather.com/wxnewpage.php

Any ideas on how to get the icons and table to work. They are working fine for me here www.waterfordcityweather.com/yr/yrtest.php


Mike

Any ideas on this guys. Want to get this working and put a link to it on my website

Cheers

Mike
Title: Re: yr.no forecasts worldwide-script
Post by: Lee10 on December 19, 2012, 06:41:10 PM
Only recently found this thread so I do apologise for not starting a new topic.

I recently have had a go at the fantastic yr.no forecast script on my website but despite it working very nicely and smoothly I can't get the graph or webcams to show up and I'm having problems getting the drop-down menus to work.

I have altered the settings in yr.nowxII.php file and changed the default location, but do I need another line or coding or alter parts of the file to achieve the results above. I have also changed the chmod settings for cache and directory folders as per installation instructions.

The website is http://www.theweatheronline.net/yr/yrtest.php

Any help would be greatly appreciated
Title: Re: yr.no forecasts worldwide-script
Post by: Bunty on December 19, 2012, 08:59:06 PM
Only recently found this thread so I do apologise for not starting a new topic.

I recently have had a go at the fantastic yr.no forecast script on my website but despite it working very nicely and smoothly I can't get the graph or webcams to show up and I'm having problems getting the drop-down menus to work.

I have altered the settings in yr.nowxII.php file and changed the default location, but do I need another line or coding or alter parts of the file to achieve the results above. I have also changed the chmod settings for cache and directory folders as per installation instructions.

The website is http://www.theweatheronline.net/yr/yrtest.php

Any help would be greatly appreciated

Sorry, but I don't know how to help you, but my yr page can bring up the Portsmouth forecast, if you want to see it.  It has the graph as well as a bunch of webcams.  http://stillwaterweather.com/yrtest.php?|50.79899141148548|-1.0912513732910156|Europe/London|Portsmouth|United%20Kingdom|GB (http://stillwaterweather.com/yrtest.php?|50.79899141148548|-1.0912513732910156|Europe/London|Portsmouth|United%20Kingdom|GB) Maybe you need to reinstall the script while carefully following instructions.

 I still wish the options for imperial measurements would work for me.   Maybe the author of the script has lost interest in supporting it.
Title: Re: yr.no forecasts worldwide-script
Post by: Lee10 on December 20, 2012, 07:35:46 AM
Thanks for your reply

It seems to work fine well the temperatue, images etc is fine if not working very smoothly but just can't get the menu to drop down when you type in the search box for a different location, was wondering if this is because of a mssing script or can you alter in yp.wII file.



Title: Re: yr.no forecasts worldwide-script
Post by: Lee10 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
Title: Re: yr.no forecasts worldwide-script
Post by: Bunty 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.
Title: Re: yr.no forecasts worldwide-script
Post by: wvdkuil 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 (http://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
Title: Re: yr.no forecasts worldwide-script
Post by: Lee10 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 ](*,)
Title: Re: yr.no forecasts worldwide-script
Post by: wvdkuil 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 (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 (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 (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
Title: Re: yr.no forecasts worldwide-script
Post by: Lee10 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 :?:
Title: Re: yr.no forecasts worldwide-script
Post by: GlosWeather 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
Title: Re: yr.no forecasts worldwide-script
Post by: wvdkuil 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 (http://www.cotswold-weather.co.uk/fcast-gloucestershire.php)
nor at your test-script http://www.cotswold-weather.co.uk/yr/yrtest.php (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 (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
Title: Re: yr.no forecasts worldwide-script
Post by: Lee10 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
Title: Re: yr.no forecasts worldwide-script
Post by: GlosWeather 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
Title: Re: yr.no forecasts worldwide-script
Post by: Lee10 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
Title: Re: yr.no forecasts worldwide-script
Post by: wvdkuil 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).
Title: Re: yr.no forecasts worldwide-script
Post by: txweather.org on June 21, 2014, 03:00:39 PM
Hopefully one day this will work with Imperial units :D
Title: Re: yr.no forecasts worldwide-script
Post by: Lee10 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
Title: Re: yr.no forecasts worldwide-script
Post by: marko30 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.
Title: Re: yr.no forecasts worldwide-script
Post by: fifeweather on November 02, 2020, 01:01:31 PM
I'm still running a customised older version of the yr.no script here (https://www.fifeweather.co.uk/index.php/fife-forecast), 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 (https://www.nordicweather.net/downloads/?5), 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!
Title: Re: yr.no forecasts worldwide-script
Post by: Lee10 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
Title: Re: yr.no forecasts worldwide-script
Post by: fifeweather 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?
Title: Re: yr.no forecasts worldwide-script
Post by: Lee10 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
Title: Re: yr.no forecasts worldwide-script
Post by: fifeweather 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!
Title: Re: yr.no forecasts worldwide-script
Post by: Lee10 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
Title: Re: yr.no forecasts worldwide-script
Post by: Lee10 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
Title: Re: yr.no forecasts worldwide-script
Post by: Lee10 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,
Title: Re: yr.no forecasts worldwide-script
Post by: wvdkuil 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 (https://www.wxforum.net/index.php?topic=36478.0#lastPost) , demo available at https://pwswd.be/wsfct4/

Wim

 
Title: Re: yr.no forecasts worldwide-script
Post by: Lee10 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