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

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.

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.

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.

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,