Author Topic: Weather Template and scripts from Leuven/Belgium/Europe  (Read 214398 times)

0 Members and 2 Guests are viewing this topic.

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 2009
    • My PWS at Leuven Belgium Europe
Weather Template and scripts from Leuven/Belgium/Europe
« on: April 28, 2013, 08:53:51 AM »
Removed old outdated post with all new information below:

I tried to move all template / scripts to one location

Leuven-Template Download and support at support => template
Current version Template: 2.8x is fully PHP7.2 - UTF-8  HTML-5  HTTPS compliant

===========================

All scripts  Download, Demo  and support at support => scripts

Forecast scripts version 4 usable in all regions
  • WXSIM plaintext.txt / lastret.txt /latest.csv
  • Met.no
  • Yr.no
  • WU
  • Yahoo
  • Darksky
For  Canada 1 script  using Environment Canada data.
For the USA 2 different scripts using NOAA/NWS data for a "Map-Click"  type and 1 using SOAP data.
Other forecast scripts  for UV and for HWA,  a local Dutch provider.

AirQuality scripts for PurpleAir sensor and Luftdaten sensor  both in two different versions

WeatherAlarm for Europe / Meteoalarm

WeatherUnderground stations-data is used for a "ColoredTables" type script and for another clone of the  "WU-History" script.

All scripts are usable stand-alone and in the Saratoga Template directly form the download.
And most of them are also included in the Leuven-Template.

===========================

I will not post individual links as they tend to change (my fault) to much.
So visit the scripts support or template support page and you will find all links there.

Wim van der Kuil

P.S. Now I have to scan all post to find other old links.
« Last Edit: July 23, 2018, 02:47:17 PM by wvdkuil »

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5620
    • KomokaWeather
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #1 on: April 28, 2013, 11:11:12 AM »
Very well done Wim.  I have scanned the documentation and seems overwhelming.  How easy difficult is it to use the template in North America?  By the way I was born and lived until age 10 near Heist op den Berg so know about the chocolates (periodically our lunch for school consisted of a chocolate bar sandwich).

Paul

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 2009
    • My PWS at Leuven Belgium Europe
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #2 on: April 28, 2013, 11:19:49 AM »
Well, units of measurement C-F and so on  no problem. 
You can test that using the personalize menu choice when loking at a demo site.

My english is no problem either because there is a langlookup from internal text (in my english) to decent english.
Although you have to iron out the language errors for yourself and future users by changing the language file for that.

The nasty diffferences are in meteowarnings  and those things.
I looked at different sites and although it does not looks overwhelming, some precise work has to be done to find the correct sources for USA and or Canada information.
I can do that if supplied with examples how it should look as compared to other sites.

Have a nice sunday, Wim

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5620
    • KomokaWeather
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #3 on: April 28, 2013, 02:13:26 PM »
Hi Wim,
I tried the easy YrNo stand-alone download first but have a couple of errors
edited url: http://www.komokaweather.com/wsMetNoSA/metnoFullPage.php

The test
1) I edited the $SITE for my location, name and website
2) entered my 'lat.' and 'long.'
3) changed local time from 'Europe/Brussels' to 'America/Toronto'
4) changed 'nl' to 'en' for default language

As you can see from the above link it shows an error but I have not made any change at all in 'metnoGeneralHtmp.php'
and the 'Updated" date is incorrect

Any suggestion where/how to correct the settings?

Thanks,
Paul
« Last Edit: April 28, 2013, 02:19:01 PM by PaulMy »

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5620
    • KomokaWeather
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #4 on: April 28, 2013, 02:21:25 PM »
Good news is that the error has disappeared.  The update time is still incorrect.

Paul

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 2009
    • My PWS at Leuven Belgium Europe
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #5 on: April 28, 2013, 02:29:26 PM »
thanks for finding this date/time problem, probably a strict european date program line i used.
i have had no other users than west-european ones.
i will also post an updated version of the sript as i do not tested  how to attacha script to a posting on this forum.
i hope it works because i saw an error in the icon part which is solved yesterday but not made it up to the download area, i think.

i will look into the date/time problem tomorrow as it is evening here already.

PLEASE be aware that you have to clean the cache as you make any changes.
In the cache an intermediate PHP array of retrieved data is kept to speed things up.
But changes in the settings can sometimes result in strange errors.

Have a nice day, Wim





Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5620
    • KomokaWeather
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #6 on: April 28, 2013, 02:41:23 PM »
Thanks Wim for your quick reply.  You likely also noticed that the date error also displays in the 'demo' test page. I did notice from the instruction to clear the cache folder and have been doing that.

edit: also notice the "48 hour detail" does not display
Paul
« Last Edit: April 28, 2013, 03:14:31 PM by PaulMy »

Online saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9578
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #7 on: April 28, 2013, 05:34:35 PM »
Congratulations Wim (and your crew) on a very slick template set!   \:D/

I am very pleased to see that some of my code is recycled and re-purposed (and even enhanced) to offer weather enthusiasts another option for a comprehensive personal weather website supporting multiple languages and weather software types.

Again, great job!   =D>  =D>  =D>

Best regards,
Ken
 
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 2009
    • My PWS at Leuven Belgium Europe
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #8 on: April 29, 2013, 08:24:17 AM »
Thanks Wim for your quick reply.  You likely also noticed that the date error also displays in the 'demo' test page. I did notice from the instruction to clear the cache folder and have been doing that.

edit: also notice the "48 hour detail" does not display
Paul
Good morning there in Canada. The time difference give me ample oppertunity to check what is going on. The MetNo/YrNo forecasts for your area only includes in the xml 3 hour data. In Europe we get in the same xml 1 and 6 hour data for the first 48 hours and then more 6 hour data for the rest of the forecast. So I have to rewrite a few things after looking into other areas of the globe to see what kind of forecast time-frames are used.
I include the changes in two scripts to address the time errors and an error in colorizing the temperatures for C to F  conversion I found.
I will look into adding the translations for the conditions (f.i.  LIGHTRAIN) in the coming days. They are translated to dutch but i forgot the translation to English.
This is a one persons business but very pleasant to do, but sometimes it takes a few days to get it all done. The adapted scripts you will find in the attachement.
Wim

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5620
    • KomokaWeather
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #9 on: April 29, 2013, 11:16:52 AM »
Bedankt Wim for your excellent follow up.  The time issue is now resolved.

A couple of items I notice and this may still be related to the 1 hour matter but want to let you know in case it is of assistance.
1) "Notice" showing for line 223 in new "metnoGenerateHtml.php" which is
Quote
$returnArray['forecast'][$i]['rain1Hr'] = (string) wsConvertRainfall($amount, $this->uomRain,$SITE['uomRain']);
2) In the detail forecast "Wednesday 01 May 2013" is missing as it displays from "Tuesday 30 April 2013" then "Thursday 2 May 2013"

Thanks for sharing the scripts and I am glad to experiment for your modification for Canada, but with only my very limited knowledge.

Paul

Offline weatherc

  • Senior Contributor
  • ****
  • Posts: 278
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #10 on: April 29, 2013, 02:11:24 PM »
@wvdkuil

Just a note, yr.no-logos are NOT allowed to be used.

I know my old yr-scripts use it but got a message about it from YR.

// Henkka

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 2009
    • My PWS at Leuven Belgium Europe
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #11 on: April 29, 2013, 02:33:01 PM »
@wvdkuil

Just a note, yr.no-logos are NOT allowed to be used.

I know my old yr-scripts use it but got a message about it from YR.

// Henkka
I reread the licence instructions, they are now clear to me. One have to give credit and a logo.
http://api.yr.no/license_data.html But I missed the link. The logo should be of Met.no.  Ok I will use that from now on.
Thanks for the warning,
Wim

Offline Maumelle Weather

  • Forecaster
  • *****
  • Posts: 1830
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #12 on: May 06, 2013, 09:03:55 PM »
Hi Wim,

I have your 3 in 1 script working here: 3 in 1

Also have gotten the page to validate HTML5, and it looks real good on my iPad.

Thanks for an awesome script.

John

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5620
    • KomokaWeather
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #13 on: May 06, 2013, 10:43:47 PM »
John,
Your wsWXsimSA looks very nice =D>

I am trying the Yr.No version and still have this
Quote
Notice: Undefined variable: color in /home/content/p/a/u/paulmy/html/wsMetNoSA/metnoGenerateHtml.php on line 223
and line 223 reads
Quote
$color = $tempArray2[$color + 30];
with the number 30 in orange colour.  http://www.komokaweather.com/wsMetNoSA/metnoFullPage.php

Also I frequently have one day missing from the details (now Thursday is missing) and it usually is the 3rd day in the forecast, and the '48 hours details' tab is not showing anything.

I will wait for Wim to get back, unless someone has any suggestions?

Paul

Offline Maumelle Weather

  • Forecaster
  • *****
  • Posts: 1830
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #14 on: May 07, 2013, 06:54:20 AM »
Hi Paul,

Try this, but first make a backup copy of your metnoFullPage.php. Open up metnoFullPage.php and scroll down to lines 85 and 86 which have:

   <meta http-equiv="Pragma" content="no-cache" />
   <meta http-equiv="Cache-Control" content="no-cache" />

Delete these lines, save it and reupload it to your webserver.  I had the same issues with mine until I got rid of those 2 lines and the error disappeared.

Hope that helps,

John

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 2009
    • My PWS at Leuven Belgium Europe
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #15 on: May 07, 2013, 07:04:03 AM »
John,
Your wsWXsimSA looks very nice =D&gt;

I am trying the Yr.No version and still have this
Quote
Notice: Undefined variable: color in /home/content/p/a/u/paulmy/html/wsMetNoSA/metnoGenerateHtml.php on line 223
and line 223 reads
Quote
$color = $tempArray2[$color + 30];
with the number 30 in orange colour.  http://www.komokaweather.com/wsMetNoSA/metnoFullPage.php

Also I frequently have one day missing from the details (now Thursday is missing) and it usually is the 3rd day in the forecast, and the '48 hours details' tab is not showing anything.

I will wait for Wim to get back, unless someone has any suggestions?

Paul
Sorry, but the current YrNo/MetNo script is usefull in Europe only, due the different xml feeds used between Europe and Canada/US. I am working on a more general solution but that will take some time. End of this month it will be tested and ready for deployment. I will certainly contact you to be the first to know.
Wimworking on a

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5620
    • KomokaWeather
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #16 on: May 07, 2013, 08:51:53 AM »
Thanks for the suggestion John, and I have made the change but the message is still there.  I will wait for Wim's rework.

Thanks Wim for your work on this.

Paul

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 2009
    • My PWS at Leuven Belgium Europe
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #17 on: May 13, 2013, 10:28:11 AM »
Thanks for the suggestion John, and I have made the change but the message is still there.  I will wait for Wim's rework.
Thanks Wim for your work on this.
Paul
OK, there is a version which probably works in Toronto Canada.  But the xml feeds are not that detailed as with Eropean places. I used the original YrNo feeds so the settings of the city you want a forecast for, has to be exact and known to YrNo.
This is how it works with the Saratoga template http://www.wiri.be/saratoga/wxyrnoFcstpage.php?lang=en
The demo page: http://www.weerstation-leuven.be/wsYrNoSA/printDemo.php?lang=en
Download from the Leuven site: http://www.weerstation-leuven.be/wsYrNoSA/printDemo.php?lang=en
===
Please be aware there are two YrNo (or MetNo) scripts. The YrNo script uses city names such as Canada/Ontario/Toronto for which two xml files needs to be downloaded. The MetNo scripts use Latitude/Longitude and are driven by 1 combined xml file.  At the moment the YrNo script works also for USA and Canada.  The Metno script works fine in Europe but still needs some adaptions before I can release it for NA.
I hope this version works better with you, have a nice day,
Wim

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5620
    • KomokaWeather
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #18 on: May 13, 2013, 10:42:20 PM »
Hi Wim,
Thanks for the updates and accommodating North America.  I have the scripts working http://www.komokaweather.com/wsYrNoSA/printFull.php and all seems very good.
and also with the Saratoga template http://www.komokaweather.com/wxyrnoFcstpage.php.  Just a little bit of tinkering to fix my initial mistakes and a couple of typo corrections in the scripts (renaming from folder wsYrnoSA to wsYrNoSA in printSaratoga.php and wxyrnoFcstpage.php).

I reviewing the forecast on both of them I observed some differences and note that with the printFull.php it shows "Weather forecast for:" whereas in the wxyrnoFcstpage.php it shows "MetNoForecast.  Did I mess up some settings perhaps; as you indicated that the MetNo is not yet released to the public, or am I misunderstanding YrNo vs MetNo? 

Paul

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 2009
    • My PWS at Leuven Belgium Europe
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #19 on: May 21, 2013, 10:57:05 AM »
As promissed the scripts for using MetNo forecasts (by latitude and longitude) are adapted to North America now. They are slightly easier to implement compared to the YrNo scripts because one does not need an exact country/region/city code.

MetNo forecast demo: http://www.weerstation-leuven.be/wsMetNoSA/printDemo.php?lang=en
The demo page links to different versions of the script (large small icons-only Saratoga).
These and other downloads: http://www.weerstation-leuven.be/
Wim

Offline KapitainOne

  • Senior Contributor
  • ****
  • Posts: 258
    • Sanford Weather
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #20 on: May 24, 2013, 02:40:29 PM »
I've been playing with your scripts here http://www.sanfordweather.com/wxmetnoFcstpage.php and if you notice the top forecast reads the first two columns right but the third will be a day out!

IE right now it reads
this afternoon    Friday evening    Saturday night    Saturday morning
where it should be
this afternoon    Friday evening    Friday night    Saturday morning

I noticed your demo site is similar!

Have I configured a date option wrong somewhere?

Thanks
Bill

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 2009
    • My PWS at Leuven Belgium Europe
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #21 on: May 24, 2013, 03:46:55 PM »
I've been playing with your scripts here http://www.sanfordweather.com/wxmetnoFcstpage.php and if you notice the top forecast reads the first two columns right but the third will be a day out!
IE right now it reads
this afternoon    Friday evening    Saturday night    Saturday morning
where it should be
this afternoon    Friday evening    Friday night    Saturday morning
I noticed your demo site is similar!
Have I configured a date option wrong somewhere?
Thanks
Bill
Hello Bill,
Different languages-different countries-different names for the same things.
As I understand you correctly you would prefer
                 2013-05-25  which is Saterday
18:00-24:00 Saterday evening 
                 2013-05-26 which is Sunday
24:00-06:00 Saterday night
06:00-12:00 Sunday morning
12:00-18:00 Sunday afternoon
18:00-24:00 Sunday evening
                  2013-05-26 which is Monday
24:00-06:00 Sunday night
06:00-12:00 Monday morning

An extra problem with these forecasts is that they do not follow nicely the 6 hour 00-06-12-18-00  time frame but are 0, 1 or 2 hours off. That is because they are based on 6 hours Zulu (Greenwich) time.
I propose to make a setting so that everybody can choose if the first 6 hour period of a calender day is called the night of the previous day.
OK?
Wim

Offline KapitainOne

  • Senior Contributor
  • ****
  • Posts: 258
    • Sanford Weather
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #22 on: May 24, 2013, 03:51:39 PM »
Wim

Yes I think that will work!

Bill
« Last Edit: May 25, 2013, 03:47:38 PM by KapitainOne »

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5620
    • KomokaWeather
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #23 on: May 25, 2013, 12:25:00 PM »
Hi Wim,
I have downloaded and added the wsMetNoSA script but it is not working correctly for me http://www.komokaweather.com/wxmetnoFcstpage.php.  I have edited metnoSettings.php as follows:
Quote
$SITE['yourArea']      = 'Komoka, Ontario (Canada)';         // #####   example   Leuven
$SITE['organ']         = 'KomokaWeather';   // #####         Weerstation Leuven
$SITE['siteUrl']      = 'www.komokaweather.ca';   // #####         www.weerstation-leuven.be
#
$SITE['latitude']      = '42.9542444';         // #####   North=positive, South=negative decimal degrees
$SITE['longitude']      = '-81.4348861';         // #####   East=positive, West=negative decimal degrees
but shows "MetNoForecast. yourArea" and "by: yourStationName".  Any suggestion on how to have the MetNo script show the correct $SITE{'yourArea'] and ['organ'] information?

Also, the forecast is not correct as it shows temperature and other conditions way different than Environment Canada local forecast and also way different than the YrNo script http://www.komokaweather.com/wxyrnoFcstpage.php which appears to be pretty close to EC for our area.  The YrNo script seems to be working fine.  Any suggestion on how to make the MetNo script show the correct forecast for my area?  The YrNo site http://www.yr.no/place/Canada/Ontario/Komoka/ seems to show the correct forecast as well.

The yrnoSettings.php is:
Quote
$SITE['yrnoID']         = 'Canada/Ontario/Komoka';   // #####   added home location
// $SITE['yrnoID']         = 'Canada/Ontario/London';   // #####   added alternate location
// $SITE['yrnoID']         = 'Canada/Ontario/Toronto';   // #####   generic adres
// $SITE['yrnoID']         = 'Belgium/Flanders/Leuven';   // #####   generic adres
$SITE['yrnoIconsOwn']   = true;             // #####   use original yrno icons or our general icons (false)
#
$SITE['yourArea']      = 'Komoka, Ontario (Canada)';         // #####   example   Leuven
$SITE['organ']         = 'KomokaWeather';   // #####         Weerstation Leuven
$SITE['siteUrl']      = 'www.komokaweather.com';   // #####         www.weerstation-leuven.be
#
$SITE['latitude']      = '42.9542444';         // #####   changed to Komoka from for Toronto North=positive, South=negative decimal degrees
// $SITE['latitude']      = '50.89518';           // #####   for Leuven
$SITE['longitude']      = '-81.4348861';         // #####   changed to Komoka from for Toronto East=positive, West=negative decimal degrees
// $SITE['longitude']      = '4.69741';         // #####   for Leuven

I don't really need both YrNo and MetNo but just trying them and see which I would prefer.

Thanks for your work on this,
Paul

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 2009
    • My PWS at Leuven Belgium Europe
Re: Weather Template and scripts form Leuven/Belgium/Europe
« Reply #24 on: May 26, 2013, 10:07:12 AM »
Hi Wim,
I have downloaded and added the wsMetNoSA script but it is not working correctly for me http://www.komokaweather.com/wxmetnoFcstpage.php.  I have edited metnoSettings.php as follows:
. . . removed to shorten
but shows "MetNoForecast. yourArea" and "by: yourStationName".  Any suggestion on how to have the MetNo script show the correct $SITE{'yourArea'] and ['organ'] information?

Also, the forecast is not correct as it shows temperature
. . . remove to shorten
I don't really need both YrNo and MetNo but just trying them and see which I would prefer.

Thanks for your work on this,
Paul
Hello Paul,
The stand alone versions use the settings file.
The saratoga version do not, as they can use the settings from within the Saratoga template.
First time installing follow these steps:
1. Move the wsMetNoSA folder to the root of the website
2. Modify the settingsfile and test
All translated metno xml's are cached inside the wsMetNoSA/cache/ folder.
So with every change in the settings, please clear the cache file.
When everything is OK:
3. Modify the settings inside the wxmetnoFcstpage by either supplying the correct values when there is no equivalent Saratoga setting or mark the line as comment.
4. Move the wxmetnoFcstpage to the Saratoga folder (mostly the root).
5. Test the page and when everything is OK  add an entry to the menu.
Now all translated metno xml's are cached inside the Saratoga  cache/ folder.
Again, with every change please delete the cache file.
Cache files are coded like: metnoCreateArr.php-50.89518-4.69741-C-kmh-mm-hPa

In your case you changed the Latitude and Longitude in the settingsfile but that affected only the stand-alone / demo versions.
There are numerous versions of Saratoga-settings files, often modified by their users.
So therefor when running inside the Saratoga template you have to check the settings inside the wxmetnoFcstpage.php. In your case the lat/long  were probably set to somewhere in Europe.
I hope this clarifies things,
Wim