WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Topic started by: wvdkuil on March 29, 2019, 04:36:11 AM

Title: Support for the "Leuven" Meteoalarm script
Post by: wvdkuil on March 29, 2019, 04:36:11 AM
Demo: https://www.weerstation-leuven.be/demowarningv3/demoWarning.php?lang=en
Download: https://leuven-template.eu/leuven_download2019.php?id=meteoalarm
Urgent temporary update: https://www.wxforum.net/index.php?topic=36482.msg376138#msg376138
Readme: The demo link has examples and full documentation about  settings and install
Known issues: link will be added when needed

Remarks:
To find the warnings for your region this  script "scrapes" the html page for your region from the meteoalarm website. As far as I know there is no other way (yet) to get the data as f.i. the RSS feeds are incomplete. There should be a better way but for now we are stuck doing it the "wrong" way.
Scraping can also result in multiple errors as  even a small change of the meteoalarm website-layout can disturb the scraping.  So when using this script make sure you can easily switch it on/off on your page.

Warning:
The settings are at the start of the script. The language translations are at the bottom. There is a big warning after the settings not to change the script itself. So if you are stupid enough to change the coding lines, do not post questions here why the script fails. Do a fresh download and only change those lines which should be changed.
Especially: DO NOT CHANGE THE URL to the meteoalarm web-site.  That one is correct. And yes, the English language is the correct language to use for scraping your regional page! 100% sure.

Support:
When you post questions about the scripts, please always include the URL (=correct link)  to the script on your website. That reduces the time for answering your questions.

Wim
Title: Re: Support for the "Leuven" Meteoalarm script
Post by: txweather.org on March 29, 2019, 12:24:26 PM
Thank you WIm!
Title: Re: Support for the "Leuven" Meteoalarm script
Post by: wvdkuil on April 10, 2019, 08:03:21 AM
There are today (2019-04-10) severe problems with the meteoalarm server.
Multiple  503 errors but the scripts catch them correctly.

But most of the time the php scripts are not executed but returned as html.
My meteoalarm script fails severely  :oops: on this unexpected garbage.

Attached a temporary fix,

Wim
Title: Re: Support for the "Leuven" Meteoalarm script
Post by: KoenDV on July 20, 2019, 03:45:09 AM
Thanks for the Meteoalarm script!
I wonder, is it possible to get only the Dutch text, and not both Dutch and French?

Regards,
Koen
Title: Re: Support for the "Leuven" Meteoalarm script
Post by: wvdkuil on July 28, 2019, 10:17:37 AM
Thanks for the Meteoalarm script!
I wonder, is it possible to get only the Dutch text, and not both Dutch and French?

Regards,
Koen
It is a setting where you choose the main language.
When checking your website it seems to display correct now.

Wim
Title: Re: Support for the "Leuven" Meteoalarm script
Post by: KoenDV on July 29, 2019, 07:46:01 AM
Hi Wim,
I've set
Code: [Select]
$lang= 'nl';
$warningSplit= true;
but both languages were still shown, so finally I could adapt the script so it does only shouw the Dutch text and the word 'nederlands' is stripped for BE  ;)

Regards,

Koen