As so many ask for it, updated my forecast-script what use the free data from yr.no. (Thanks to Jim Mcmurry for kicking me to get it done :))
It shows the 10-day forecast using the free data from yr.no. There are currently over 7 million of citys to choose from.
New:
Multicity-pulldown with ablity for multiple country’s too
There are 17 citys as sample (my array) with 16 finnish and 1 swedish city
Configurable settings
*Temp as C or F
*Rain as mm or in
*Baro as in or hPa
*wind as m/s, km/h or mph
Added yr.no-logo & headerimage for the tables
Changed to the avanced meteogram
Works both stand-alone and as an include
Added in update:
Option for multilanguage using the $lang-parameter
Autodetecting if standalone or include
W3 valid
Added css- and lang-files
Remade the city-pulldown for easier customation
Update 2:
And this part has me stumped. i see alot of finland in their. Do we have to put United_States in place of where it says Finland in all of them spaces?
/ Pulldown-settings
// This is the tricky part... :p
// To get right settings here go to yr.no and find city you want and take the URL of it, ex.
// http://www.yr.no/place/Finland/Western_Finland/Halikko/
// - Finland is $country
// - Western_Finland is $region
// - Halikko is $city
$country = array
('United_States','Finland','Finland','Finland','Finland','Finland','Finland','Finland',
'Finland','Finland','Finland','Finland','Finland','Finland','Finland','Finland','Sweden');
$region = array('Washington','Western_Finland','Western_Finland','Southern_Finland','H
Just below those arrays is a default number that is 2. Make that 0 and it’ll use you location info. I also had to work on the paths to the images, so you may have to do that too.
Im getting the samething here.
And this part has me stumped. i see alot of finland in their. Do we have to put United_States in place of where it says Finland in all of them spaces?
Few things guys:
cache-folder. Check that setting and also check the folder is there and writeble so the script can write the xml to it, thats why you don’t see anything. If you check the source-code there are a
<!--Unable to write cache cache/Turku.xml -->
in this case, create a cache-dir in root-dir, chmod it to ex 766 and it should work
This message will disappear once it can write the file.
For the arrays:
I. go to yr.no
II. search for city of choice and take the url of it
Example my place have this url: http://www.yr.no/place/Finland/Western_Finland/Halikko/
So Finland comes in $country
Western_Finland in $region
and Halikko in $citys
all as they are in the url, if there are a “_” then it should be also in the array.
Still no luck. I understand the arrays, but the script seems to get stuck. I have a file called cache.xml with full permissions on my web site and changed the cache settings to 30 just to try to get it going.
EDIT:
Firewall:
Your page works now, at least when tested with ex. Helsinki
Then its just the timetaker to figure out the urls for citys you want in the list
@ALITTLE: Your page still says it can’t write to the cache-folder?..Is it in root (or from wherever you run the page), ex. in same folder where wxtest.php is located?
You can allways test with one of the finnish citys to see if works, thats why I left them there.
yes, the folder is in my default /web directory, same place where the test page is. I do have the script in another folder. i wonder if the path to the cache file needs changed. Ive tried changing it, but nothing has worked.
yes, the folder is in my default /web directory, same place where the test page is. I do have the script in another folder. i wonder if the path to the cache file needs changed. Ive tried changing it, but nothing has worked.