WXforum.net
Web Weather => Weather Website PHP/AJAX scripting => Topic started by: wvdkuil on March 28, 2019, 04:27:01 PM
-
All the "Leuven" weather-forecast scripts are in 1 folder and in 1 download. Currently the following forecasts are available :
- WXSIM-plaintext, WXSIM-lastret/latest.csv
- Met.no
Yr.no the data source will be discontinued start of 2021 - Darksky.net the data source will be discontinued end of 2021
- UV from KNMI/Temnis
- Environment Canada + weather warnings
- NOAA/NWS plaintext type + weather warnings
- NOAA/NWS SOAP detailed data
Index of all demo pages: https://www.weerstation-herent.be/wsfct4/
Download: https://leuven-template.eu/leuven_download2019.php?id=forecasts
Readme: https://www.weerstation-herent.be/wsfct4/readme.html
Known issues: link will be added when needed
Remarks:
Although you will receive all scripts in 1 download, I think it is unwise to use them all.
Most often 1 default forecast and 1 "back-up" forecast is all that is needed.
Positive: "A lot of settings" To adjust what contents you want, what colours a.s.o.
Negative: "A lot of settings" The output is cached, so you have to learn to clear the cache when testing a change in your settings.
These scripts can be used Stand-Alone and in the Saratoga-template.
They could be used in the Leuven-Template also, but they are not supported there! Use at your own risk.
These are very extensive and complex scripts, do not change the scripts themselves.
Change only the settings and the startpages. All as described in the readme.
Support:
When you post questions about the scripts
- Always include the URL (=correct link) to the script on your website
- Check the demo scripts to see if the problem exist there also. Sometimes the forecast servers are the cause of the problem
- Also states all other actions you already did to pinpoint the cause of your problems.
Checking those things also helps to reduce the time for answering your questions.
Wim
-
=D> =D> Outstanding, Wim -- thanks for sharing these!
-
Danke Wim Super [tup]
-
Wow! What a great script. Excellent. [tup]
-
Hello,
I installed your Forecast scripts, but how do I set the Italian language? I put the file in the "lang" folder, set in the php file: lang: "it" but it doesn't translate it for me, why?
Thank you
-
Hello,
I installed your Forecast scripts, but how do I set the Italian language? I put the file in the "lang" folder, set in the php file: lang: "it" but it doesn't translate it for me, why?
Thank you
@ALL PLEASE ALWAYS INCLUDE THE URL TO YOUR WEBSITE / SCRIPT
As from now, no answers if you do not include the links.
@metosa
I will use the Italian language as example, but it works the same for most western languages
To install 1 extra language, follow these steps
- In the wsfct4/lang/ folder copy one of the current language files f.i. fctlanguage-en.txt and change the name to fctlanguage-it.txt
- DO NOT COPY any other language file you may have, use only a copy of an existing file in the lang folder
- Carefully change all texts at the right to Italian
- Change the allowed languages around line 250 in your settings file , in this case _metric_settings.php to contain your new language
That array to change is below the warnings about knowing what you are doing. Be careful.
# ----------------------------------------------
# language settings
#-----------------------------------------------
$ws_langs_supported = array ('en', 'nl', 'fr', 'de');
Change to
# ----------------------------------------------
# language settings
#-----------------------------------------------
$ws_langs_supported = array ('en', 'nl', 'fr', 'de','it');
Wim
-
Hi, Wim excellent script thanks. [tup]
It could be an idea to make a yr.no script (which in my opinion is one of the most reliable) for mobile devices by putting only 3 forecasts on one line then on the line under other 3 forecasts.
-
Hi, Wim excellent script thanks. [tup]
It could be an idea to make a yr.no script (which in my opinion is one of the most reliable) for mobile devices by putting only 3 forecasts on one line then on the line under other 3 forecasts.
Thanks for the compliment.
I use the scripts myself also for the mobile devices.
The forecast is in a separate page with a normal forecast so users can scroll / move through all info.
Maybe next year i will have time to make a new 'responsive' version also.
Wim
-
Wonderful work on this Wim. And, thanks for your support on the Weather34 templates, too.
The one question I have is related to the DarkSky forecasts when used within Ken's Saratoga templates. I've followed your setup instructions and it seems to be working fine, with the exception of template width issue (looking forward to responsive templates for everything) but under the forecast header appears..."Forecast data created at Monday Jan 27 2020 - 9:26am For Station Xetc, etc." I get my Lat/Long location added on. I really don't want the GPS location of my station shown. Is there something wrong with the way I've set this up, or is there a simple way to turn this off or comment it out?
Thanks
Tim
-
Wonderful work on this Wim. And, thanks for your support on the Weather34 templates, too.
The one question I have is related to the DarkSky forecasts when used within Ken's Saratoga templates. I've followed your setup instructions and it seems to be working fine, with the exception of template width issue (looking forward to responsive templates for everything) but under the forecast header appears..."Forecast data created at Monday Jan 27 2020 - 9:26am For Station Xetc, etc." I get my Lat/Long location added on. I really don't want the GPS location of my station shown. Is there something wrong with the way I've set this up, or is there a simple way to turn this off or comment it out?
Thanks
Tim
i am on vacation with insufficient internet. There is a setting to switch off testing/debug and that will also remove the lat-Lon numerals.
I will be back Feb 1 and will check this out
Wim
-
Thanks Wim. I might be looking in the wrong place. Haven't managed to turn off the testing switch, so still seeing lat/lon.
Tim
weatherola.com
-
Thanks Wim. I might be looking in the wrong place. Haven't managed to turn off the testing switch, so still seeing lat/lon.
Tim
weatherola.com
The settings files, such as _metric_settings.php contain the setting to switch all errors (and other debug code) off when you are finished testing.
Set $ws_errors to false and the string such as "Forecast data created at Saturday 01 February 2020 - 17:55 For: 51.904,5.69" will not be shown.
If you later on doubt if there is "a problem / error" simply add ?debug or &debug to your URL and the date/time/lat/lon will be shown with all other "messages"
Succes, Wim
#-----------------------------------------------
# for ALL websites using metric units
#
#-----------------------------------------------
# # # Here you have to make the changes # # #
# # # for stand-alone use # # #
#-----------------------------------------------
# error messages on or off
# always set to false for production versions
#
$ws_errors = false; # false when ready testing
#-----------------------------------------------
-
Thanks Wim for clarifying the location for the switch. Unfortunately, setting the switch to "false" still leaves me with the string showing. I am using the _us settings and changed it there as you suggested. I would think that would have removed it, but alas, no. All is the same. If you'd like to have a look, feel free to visit weatherola.com. Sorry to be such a pest.
Tim
-
Wim,
The switch seems to be working, now. Though I tried it on a couple of computers earlier, the debug code is no longer visible and switched off. Caching, I assume. All better now.
Thanks again for your help, Wim.
-
I posted this question to the wrong forum earlier.
I'm trying to run the Wunderground colored table history script. When I run the script, I get this error:
ERROR: no data for http://change_to_your-site_in_wsReports1part.php/WXDailyHistory.php?ID=KNCMOREH2&month=01&day=01&year=2016&format=1&graphspan=year
I have been running Weather Underground for my site KNCMOREH2 for several years now.
Any help is appreciated,
Chris
-
I posted this question to the wrong forum earlier.
I'm trying to run the Wunderground colored table history script. When I run the script, I get this error:
ERROR: no data for http://change_to_your-site_in_wsReports1part.php/WXDailyHistory.php?ID=KNCMOREH2&month=01&day=01&year=2016&format=1&graphspan=year
I have been running Weather Underground for my site KNCMOREH2 for several years now.
Any help is appreciated,
Chris
Please be specific.
Your last post https://www.weather-watch.com/smf/index.php/topic,68752.msg555633.html#msg555633
=> is about a version 4 forecast script wsfct4/wsIncWuCreate.php
Now you are posting in the forecast topic about the coloured table script
The general support page with all links for all Leuven scripts is at: https://support.leuven-template.eu/
For the script you are now talking about the support topic is:
https://www.wxforum.net/index.php?topic=36473.msg374472#msg374472
This readme describing how to install the MITM scripts is included in the download and should be in the wsreports folder on your server also. https://www.weerstation-herent.be/wsreports/WU_CSV_problems_readme.pdf
But if you post in the forum without a link to the start-page of the script, nobody can help you as, AFAIK, none of the visitors on this forum is clairvoyant.
Wim
-
Hello weather enthusiasts and Leuven users
After spending time with other templates, I decided to do a fresh Leuven installation, because it’s still a fantastic template - I really like how customizable it is. So thanks
to Wim for keeping it alive.
However I need some help, because I’m struggling with some errors while debugging.
Notice: Undefined index: iconDtl in /var/www/vejrstationen.dk/public_html/weather28/wsmetno3/metnoGenerateHtml.php on line 186
Notice: Undefined index: iconDtl in /var/www/vejrstationen.dk/public_html/weather28/wsmetno3/metnoGenerateHtml.php on line 186
Notice: Undefined index: weatherDescDtl in /var/www/vejrstationen.dk/public_html/weather28/wsmetno3/metnoGenerateHtml.php on line 189
Thanks in advance and happy windy Sunday
Sent from my iPad using Tapatalk
-
Hello weather enthusiasts and Leuven users
After spending time with other templates, I decided to do a fresh Leuven installation, because it’s still a fantastic template - I really like how customizable it is. So thanks
to Win for keeping it alive.
However I need some help, because I’m struggling with some errors while debugging.
Notice: Undefined index: iconDtl in /var/www/vejrstationen.dk/public_html/weather28/wsmetno3/metnoGenerateHtml.php on line 186
Notice: Undefined index: iconDtl in /var/www/vejrstationen.dk/public_html/weather28/wsmetno3/metnoGenerateHtml.php on line 186
Notice: Undefined index: weatherDescDtl in /var/www/vejrstationen.dk/public_html/weather28/wsmetno3/metnoGenerateHtml.php on line 189
Thanks in advance and happy windy Sunday
Sent from my iPad using Tapatalk
The link to the page: https://www.vejrstationen.dk/weather28/index.php?p=ws_metno_page&lang=en
Thanks for bringing these "notices", not "errors" to my attention. I knew there were some changes scheduled in the 1.9 API.
I do not get these notices myself, but it seems that the time is right to start debugging.
I will use your settings for that "Data for latitude=55.899269 - longitude= 8.516578"
@ALL When switching debug to false in your settings, the notices will not be shown, nor appear in in the logs.
These are not "errors", it are "notices" to the script author that the scripts need to be enhanced.
When in debug mode the scripts print all possible messages "notice", "strict", "deprecated", "warning", "error" and "fatal"
Wim
-
Hello weather enthusiasts and Leuven users
After spending time with other templates, I decided to do a fresh Leuven installation, because it’s still a fantastic template - I really like how customizable it is. So thanks
to Win for keeping it alive.
However I need some help, because I’m struggling with some errors while debugging.
Notice: Undefined index: iconDtl in /var/www/vejrstationen.dk/public_html/weather28/wsmetno3/metnoGenerateHtml.php on line 186
Notice: Undefined index: iconDtl in /var/www/vejrstationen.dk/public_html/weather28/wsmetno3/metnoGenerateHtml.php on line 186
Notice: Undefined index: weatherDescDtl in /var/www/vejrstationen.dk/public_html/weather28/wsmetno3/metnoGenerateHtml.php on line 189
Thanks in advance and happy windy Sunday
Sent from my iPad using Tapatalk
The link to the page: https://www.vejrstationen.dk/weather28/index.php?p=ws_metno_page&lang=en
Thanks for bringing these "notices", not "errors" to my attention. I knew there were some changes scheduled in the 1.9 API.
I do not get these notices myself, but it seems that the time is right to start debugging.
I will use your settings for that "Data for latitude=55.899269 - longitude= 8.516578"
@ALL When switching debug to false in your settings, the notices will not be shown, nor appear in in the logs.
These are not "errors", it are "notices" to the script author that the scripts need to be enhanced.
When in debug mode the scripts print all possible messages "notice", 'warning", "error" and "fatal"
Wim
Thanks for clearing this out Wim [tup]
I’m ignoring the message then, and moving on to production.
-
@ALL When switching debug to false in your settings, the notices will not be shown, nor appear in in the logs.
. . . shortened . . .
Wim
Thanks for clearing this out Wim [tup]
I’m ignoring the message then, and moving on to production.
The last hourly forecast seems "incomplete", but not in all cases.
I added some code to use the icon and description from the 6-hour forecast when there is no corresponding hourly data.
Could you ,please use this version for a few days?
You can always check if there are errors by adding &debug to the url
Wim
-
Looks like Yrno forecast is also changed.
Not sure if there is already a topic about.
The Leuven support forum is not readable for me anymore.
The xml has changed.
Well something to do I guess.
The yr.no forecasts contain a hidden warning to the script-programmers.NB!!! Since we have no other options to contact our users of forecast.xml, we have decided to use this method to get your attention to some major changes with our API
In the first quarter next year, forecast.xml and forecast_hour_by_hour.xml will be discontinued in favour of a newer JSON API.
Vi encourage you already now to switch to the new API.
There are a lot of changes, and you can read all the technical details in our new developer portal https://developer.yr.no
They also show a message to read that warning in the data-fields on some forecasts during the day.
That is their only way to bring this to the script-authors attention, but it looks not nice for the visitors of the websites.
The yr.no script will not be adapted as yr.no data will be replaced with data identical to met.no.
The yrno and metno forecast will be identical. You should remove the Yr.no forecast from the menu early 2021.
It is not clear yet, if we can continue to use the yr.no meteogram-image and the full page .pdf.
The met.no script needs will need
* 1 minor change, the version number in the URL should be changed from 1.9 to 2.0
and
* will remain identical when we add a new "classic" keyword. Clarification added 2020-08-11 11:40 CEST
I am testing it and the resulting xml seems identical, but I will follow closely if that will change.
DO NOT change to version 2.0 yourself without checking the API documentation. You are on your own with that.
Let me test it first. The 1.9 version is still the current production metno version.
Wim
-
Hi Wim,
thanks for the info about the warning concerning the yr.no script - much appreciated. I have just noticed this myself and are now trying to change the script to metno. The scripts have changed quite a bit but managed - thanks to the readme file - to set it up. Nevertheless I must have made a mistake somewhere as I am not able to get it working ("invalid forecast data retrieved, check the html for errors"). Any ideas what I might have missed? I am a bit confused with point 7. in the stand-alone tab.
Thanks for your time (and this awesome scripts) and best regards,
Markus
-
Hi Wim,
thanks for the info about the warning concerning the yr.no script - much appreciated. I have just noticed this myself and are now trying to change the script to metno. The scripts have changed quite a bit but managed - thanks to the readme file - to set it up. Nevertheless I must have made a mistake somewhere as I am not able to get it working ("invalid forecast data retrieved, check the html for errors"). Any ideas what I might have missed? I am a bit confused with point 7. in the stand-alone tab.
Thanks for your time (and this awesome scripts) and best regards,
Markus
And I am a bit confused also as i am not clairvoyant.
I even checked your previous posts but i can not find a working link to a leuven-metno script.
Without a link to the script there is nothing i or anyoneelse can do.
Wim
-
Thanks a lot Wim for your prompt reply. Clairvoyant, I have learned something new :grin: - English is not my mother tongue.
I haven't uploaded the new scripts to my online page, I am just testing locally (xampp). I have attached the three files I have edited: (sorry didn't work with the attachments). How can I attach txt files without cluttering the whole page?
Edit: weird it seems to have worked after all (attachments).
-
. . .Nevertheless I must have made a mistake somewhere as I am not able to get it working ("invalid forecast data retrieved, check the html for errors").
. . .
Well, next time I will not even look and invest my precious spare time if you do not include an accessible link with your post.
You should have posted the complete message which appeared before the complete forecast. You gave me the impression that there was no forecast at all.
I copied your two files to the original download and the weather-forecast appeared correctly. See attached screenshot.
But also a clear message, first line with the link, second line to check the html
No data was retrieved for http://www.temis.nl/uvradiation/nrt/uvindex.php?lon=137.86&lat=36.7
no forecast data can be retrieved, check the html for errors
The UV part does not come from met.no but from temis.nl
You could have done a lot of yourself by copying that link that displayed link to your browser yourself and notice it takes about a minute before the website answers.
That is too long for your visitors to wait. We wait only 4-10 seconds and then try to use the cache, which can be to old to use also.
In that case there is a one-time message every new ( 1/hour approx.) generating of the cached files.
Only if "error messages" is switched on, of course, which you can switched off in line 12 of the settings.
For missing data there is also always a setting
=> line 76 in wsMetnoPage.php, set to false and there will be no error for to old UV cache and a stalled UV-server even with "error messages on".
You also mentioned: thanks for the info about the warning concerning the yr.no script - much appreciated.
...
The scripts have changed quite a bit but managed - thanks to the readme file
Good work, fine that you "managed", fine that you "appreciate" all the hard work
By the way, the fact that those scripts are donation-ware never changed in the past 6 years.
succes, Wim
-
Finally I got it running, thank you so much for your help Wim - outstanding support.
At the end I found the problem. You noted the solution here: "DO NOT change to version 2.0 yourself without checking the API documentation. You are on your own with that. Let me test it first. The 1.9 version is still the current production metno version", which wasn't there when I read that post or didn't see it and therefore of course did the change to 2.0. Reversing it to 1.9 did the trick.
You should have posted the complete message which appeared before the complete forecast. You gave me the impression that there was no forecast at all.
I am sorry for the troubles but all I saw was the error message: "invalid forecast data retrieved, check the html for errors".
Anyhow, all is working fine now. Great scripts and amazing support.
Thanks a lot, Markus
-
Hi Wim,
comparing the output (forecasts) from met.no to yr.no shows that they are quite different. Somehow the forecasts in met.no don't line up with the times (e.g. this morning shows the afternoon forecast and so on). I don't know how to explain it in an understandable language and I have therefore attached a pdf comparing the to forecasts.
I remember that a long time ago when I first came across your scripts I installed the metno scripts and then switched to yrno for that same reason. As the yrno scripts are going to not be continued I have to find out the problem so I can switch to metno in due time.
I have send you a pm with the link to the yrno scripts if needed.
Thank you and have a nice weekend.
-
Hi Wim,
comparing the output (forecasts) from met.no to yr.no shows that they are quite different. Somehow the forecasts in met.no don't line up with the times (e.g. this morning shows the afternoon forecast and so on). I don't know how to explain it in an understandable language and I have therefore attached a pdf comparing the to forecasts.
I remember that a long time ago when I first came across your scripts I installed the metno scripts and then switched to yrno for that same reason. As the yrno scripts are going to not be continued I have to find out the problem so I can switch to metno in due time.
I have send you a pm with the link to the yrno scripts if needed.
Thank you and have a nice weekend.
I am more then willing to investigate.
But without link a website running the original scripts, there is not much I can do.
A screenshot does not explain anything, a script which I can run, settings I can check is what is needed.
Do not change the new metno scripts as you did with your yrno scripts.
There is really no need to rename all scripts to hakubaprintfull.php a.s.o.
No need to change any code lines outside the settings.
This makes supporting for me impossible.
Maybe you should change the wording for afternoon / morning a.s.o.
MetNo scripts use the 6 hour periods 00 06 12 18 UTC. => morning is from 09-15 for your timezone
Yrno has the first periods adapted to your local timezone, the remaining are also in UTC. => morning is 06-12 for the first few days.
Also you could try another forecast such as WeatherUnderground.
Otherwise there are multiple fine forecasts available from other sources for your area.
Just a small Google search will help you to find other ones.
Please compare those different forecasts, maybe that gives you a forecast better suited for your goal.
Wim
-
Thanks Wim for your help - greatly appreciated.
I haven't renamed the metno scripts as it is indeed easier leaving them as is (exception wsFctMetnosmall4 to wsFctMetnoIcons4 as it made more sense in my case).
I am at a complete loss about the times, how they are transformed/changed from UTC to JST. Something just doesn't make sense to me. Why is in JST morning from 09 -15? Why are we moving everything +6 hours? Shouldn't it be +9 hours? I tried to understand wsIncMetnoCreate but haven't bent my brain around it yet.
I am already using another local forecast for my personal use, but they don't provide a website script. As far as I know only met.no resp. yr.no provide weather for my town (small town).
I will try to find a solution.
Cheers, Markus