YR.NO forecast PHP-script - updated

I really would like some help to get this latest script running, if possible.
What should I do with the cache folder I have to create.
Where exactely on the server and what files should be in it, for starters.
Should it be in the same folder as the script is.
I don’t understand.

Also, why do I have to create a Geonames account.

I am getting function.date and function.mktime errors.
This has something to do with the timezone.
For all I know, I did set it correct in the script settings.

That’s it… for now. :lol:

TIA

Has anyone thought of a way to do that yet? It would be extra cool to see the Dallas skyline in yowindow after submitting Dallas.

You can do that now by using your own photo then making the sky transparent. Check out http://yowindow.com, there are instructions there.

  • Jim

Hi,

I have been trying to get this script to work for ages with no luck. I have created the geonames account, uploaded the files, created the cache folder (and made it 777) and changed everything I think needs changing in yr_xmll.php. I cant seem to get it to bring up my location of Bath, in the UK. Would anyone be able to take a look at the attached code to see if they can find what I am doing wrong.

I would be eternally grateful.

Paul


yr_xmlII.txt (42.7 KB)

Thanks, but I’ve already did that successfully with yowindow alone as with this page: http://stillwaterweather.com/animatedforecastosu.php However, could not get it to work with yrno, so settled for this: http://stillwaterweather.com/yrno.php Once again, it would be beyond cool to submit Dallas and then see rain, or whatever, on the Dallas skyline, but it may not be feasible.

Have you tried using the newer version? It’s probably a little better. I only use the older version, because unlike the new version, I can make adjustments away from metric and arrange the order of dating the way I want it.

Hi bounty,

Yes I am using the latest version. Downloaded it direct from henriks site.

Paul

So in looking over your yr_xmll.txt file, I noticed you have files starting on line 31 being directed to the root folder, rather than the yr folder. In other words, $imgdir = “images/”; should read yr/$imgdir = “images/”; And so on for 3 more files on the next 3 lines. See if making those changes help. You should have a yr folder.

Bunty,

Thanks for the response. I have changed the location of those 3 files so that they no longer point to the root directory. They now look like “$jsfolder = ‘yr/jquery/’;” This still unfortunately doesn’t seem to work…

Paul

$geonameusr = "paulwilman73atgmail.com"; // IMPORTANT! You need to signup at geonames.org (FREE), [b]put username here[/b]

You are sure this is correct?
This is your emailadres you probably signed up with at geonames.
Is that your username as well?

Hi Paul

I have spent hours trying to get the YR V2 working to no avail, very intermittently works and caches the xml files correctly. I have started to disassemble the code as I have had no reply to a mail I sent Henkka I expect he is busy as he has a newer cooler one on his site YR V3, maybe. Anyways, I have deduced the problem lies around the geonames account and you can test it by changing the username back to the original one as in the script ‘weatherc’ and then you can select a country and city and it works ok. What I am looking at doing is modifying the script to default to a Country and Town (City) and seeing if that improves matters.

I will of course post here when I have some sort of fix. YRNO are a great forecast org and that is why I have integrated their forecasts on my pages.

http://www.thebayweather.com/forecasts/yrtest.php?en if you then select Country and City this retrieves a forecast too.

This works as it retrieves the lat long from Geonames and creates the following url for you;

http://www.thebayweather.com/forecasts/yrtest.php?en|53.294827837145796|-3.726735294419097|Europe/London|Colwyn%20Bay|United%20Kingdom|GB

But I can’t use it as a default because when you paste the URL back into your browser (Safari for me) the url gets changed ?>

http://www.thebayweather.com/forecasts/yrtest.php?en%7C53.294827837145796%7C-3.726735294419097%7CEurope/London%7CColwyn%20Bay%7CUnited%20Kingdom%7CGB

Which presents the problem of having a default forecast…

Love your site btw :slight_smile:

Saving the pennies in piggy for WXsim

Cheers

Andy

Andy,

Glad you like my site. All thanks to my next door neighbor who converted my rather clumsy html code into php.

Sounds like you have been having the same problems with the yr.no script as I did. I also only managed to get it to run when I selected the locations. I have reverted back to the original script of Henka’s which doesn’t look as good, but does the trick. I have incorporated it with the WU forecast as well.

My page ishttp://www.paulwilman.com/WU_forecast.php

Thanks for everyone’s help. Happy New Year forum!

Paul

Hi

I’m trying to get this script working, but I’ve trouble with “allow_url_fopen=0” on my server, and the webhost, does not permit to change it.

Can the script work anyway somehow?

Hello
excuse my bad english, this is a google translation
congratulations on your script but I have a problem with the rain is not displayed in the chart
I have not changed the script code
Have you ever experienced this problem
thank you

Help please, How does one sign up to geonames.org, I’ve search the site. ?

Update found it hiding away on the Web Services Documentation

Hello everyone. I have tried to get this great script to show temperature( F instead of C) Pressure inHg instead of hPa and Precipitation in inches not mm. Only thing I seem to have gotten was wind MPH. Any help would be appreciated. http://www.sekywx.com/weather/wxyoforecast.php

Looks fine here F, in.


The top part (yo Window) is correct. I can’t get the bottom of the page to read correct English unit measurements. http://www.sekywx.com/weather/wxyoforecast.php

Any help? I have seen other weather sites that have the correct English measurements. Can’t get mine to do that.
My coding is as follows,

// CONFIG START

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

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

There is no known solution to the problem you site in the last version. Therefore, you must use the version, which came before it, which explains what you saw on other sites. It should be settable using imperial.