WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Topic started by: Axelvold on July 18, 2012, 01:23:48 PM

Title: get-meteoalarm-warning-inc.php
Post by: Axelvold on July 18, 2012, 01:23:48 PM
I use this on my frontpage to display weather warnings, but suddenly today it stopped working and I cant figure out why.

Any suggestions?

script is attached.
Title: Re: get-meteoalarm-warning-inc.php
Post by: Axelvold on July 18, 2012, 01:57:42 PM
I did find this change in the cache file.

They changed from this
Code: [Select]
<div class="warnbox wb1">
to this
Code: [Select]
<div class="warnbox awt nt l l2">
Could it be this that caused this script to stop working?
Title: Re: get-meteoalarm-warning-inc.php
Post by: saratogaWX on July 18, 2012, 05:23:45 PM
Yep, that and a few other changes in the meteoalarm.eu website.

I've updated the script to V2.08 - 18-Jul-2012 to address the issues.

V3 template users can use the update tool (http://saratoga-weather.org/wxtemplates/updates.php) (18-Jul-2012, Base-World) to get the script.

V2 template users/standalone can download from the script page (http://saratoga-weather.org/scripts-EUwarning.php#EUwarning)

Best regards,
Ken
Title: Re: get-meteoalarm-warning-inc.php
Post by: Axelvold on July 19, 2012, 12:51:22 AM
Thanks Ken

I just have one small problem, can't get characters like Å Ä Ö to show up.
Title: Re: get-meteoalarm-warning-inc.php
Post by: Axelvold on July 19, 2012, 02:28:58 AM
the issue is resolved.

Did change ISO-8859-1 to utf-8
Title: Re: get-meteoalarm-warning-inc.php
Post by: jdee on July 19, 2012, 03:03:30 AM
thank you gents - I had the same problem.
Title: Re: get-meteoalarm-warning-inc.php
Post by: saratogaWX on July 19, 2012, 12:34:38 PM
Ah.. tis true.  The script defaults to converting the meteoalarm.eu output from UTF-8 to ISO-8859-1 for use in the template sets.

If you're running your non-template site in UTF-8, then changing
Code: [Select]
$charsetOutput = 'ISO-8859-1';        // default character encoding of output
to
Code: [Select]
$charsetOutput = 'UTF-8';        // default character encoding of output
will leave the output in UTF-8 for you.

Best regards,
Ken
Title: Re: get-meteoalarm-warning-inc.php
Post by: Cavaliere on January 10, 2019, 06:33:33 AM
Hi everyone,

I finally found the correct discussion for my problem, I can not display accented characters on the meteoalarm script, I tried to put both UTF-8 and also ISO-8859-1 wh

Resolved ;)
Title: Re: get-meteoalarm-warning-inc.php
Post by: Cavaliere on January 11, 2019, 02:34:22 AM
Good morning guys,

I continue to have problems with the letters accented in Italian on this script. (è à òù) why?
Title: Re: get-meteoalarm-warning-inc.php
Post by: saratogaWX on January 11, 2019, 10:50:07 AM
You are running the correct version of the script, and have the output set for UTF-8.

The problem comes from the source of the data at https://www.meteoalarm.eu/it_IT/0/0/IT018-Sicilia.html

They are reporting
Quote
Non ? richiesta alcuna attenzione speciale
on their page.  It's likely that someone at the meteoalarm or the Italian weather bureau used ISO-8859-1 instead of UTF-8 for posting that message.  The script cannot back-convert to remove their error.  Sorry...
Title: Re: get-meteoalarm-warning-inc.php
Post by: Cavaliere on January 13, 2019, 03:57:11 AM
You are running the correct version of the script, and have the output set for UTF-8.

The problem comes from the source of the data at https://www.meteoalarm.eu/it_IT/0/0/IT018-Sicilia.html

They are reporting
Quote
Non ? richiesta alcuna attenzione speciale
on their page.  It's likely that someone at the meteoalarm or the Italian weather bureau used ISO-8859-1 instead of UTF-8 for posting that message.  The script cannot back-convert to remove their error.  Sorry...

Ok thanks so much so it's not a mistake that depends on the script, but on the meteoalarm site itself.

While I do not understand how to update the alerts for now in my region in Sicily I see an orange alert but the script does not report the image with the warning why?
Title: Re: get-meteoalarm-warning-inc.php
Post by: saratogaWX on January 13, 2019, 05:05:24 PM
It may have just been a cache issue -- I see on your page
Quote
inizio validit? dal 13.01.2019 12:00 CET fino a 14.01.2019 23:59 CET
Vento  Livello di pericolo: Giallo
english: Wind gusts >30kt BE AWARE, keep up to date with the latest weather forecast. Expect some minor disruption to outdoor activities italiano: Raffiche >30kt STARE (RIMANERE) ATTENTI. Tenersi aggiornati con le previsioni del tempo più recenti. Aspettarsi alcuni disagi minori per le attività all'aria aperta.
and the yellow caution image for alerts.

The default in the get-meteoalarm-warning-inc.php is 300 seconds (5 minutes) for the cache lifetime.