WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Topic started by: meteosanjuan on March 26, 2024, 06:13:37 PM

Title: advisorybox does not work
Post by: meteosanjuan on March 26, 2024, 06:13:37 PM
Hello, the advisorybox that I have included on the website does not work for me. Right now there is a warning issued by the meteorological agency and it does not indicate it. Furthermore, I get the feeling that it damages the presentation of the website, since it takes too long to load.

https://www.meteosanjuan.com/

What can I do to solve?

Thanks
Title: Re: advisorybox does not work
Post by: saratogaWX on March 26, 2024, 06:48:29 PM
I did a view-source of your wxadvisory.php?force=1 to cause the script to fetch the data from meteoalarm.org

It showed
Quote
<!-- Fetch Status:
get-meteoalarm-warning-inc.php (976) ES_warnings: time spent: 30.0015 -  invalid CURL Connection timed out after 30001 milliseconds https://feeds.meteoalarm.org/api/v1/warnings/feeds-spain
get-meteoalarm-warning-inc.php(386) invalid data load

 -->

So the problem with the long delay (sometimes) when loading your page is due to the connectivity between your webserver and feeds.meteoalarm.org server.  It is something that the technical support of your hoster will need to address.
When I load that feed, it takes 5 seconds to load the 1.6Mbytes of XML.

because the connection is timing out and not getting fresh data, it shows there are no alerts available.
Title: Re: advisorybox does not work
Post by: meteosanjuan on March 26, 2024, 07:29:19 PM

The thing is, it worked before. Ok, let's see how I get that to the hosting provider.

Thanks Ken
Title: Re: advisorybox does not work
Post by: meteosanjuan on March 27, 2024, 08:40:58 AM
Ken, would it be difficult to temporarily deactivate the advisorybox while they solve the problem? I'm afraid my ISP won't listen to me.

Thanks
Title: Re: advisorybox does not work
Post by: saratogaWX on March 27, 2024, 10:27:13 AM
Not at all difficult.

In Settings.php, change
Quote
$SITE['useMeteoalarm'] = true;
to
Quote
$SITE['useMeteoalarm'] = false;
and both the home page and wxadvisory.php will not try to load get-meteoalarm-warning-inc.php
Title: Re: advisorybox does not work
Post by: meteosanjuan on March 27, 2024, 04:59:02 PM

Thanks Ken, I take note. Incredibly it works again and it hasn't been working for weeks and I haven't even contacted my ISP. So for now I'll leave it as is.
Title: Re: advisorybox does not work
Post by: saratogaWX on March 27, 2024, 05:42:00 PM
Some say "Internet happens"  :roll:  #-o (with a small snark in their voice).

There was likely a transient routing issue from your webserver to the feeds.meteoalarm.org webserver.

It's now responding to your query of it with < 1 second time
Quote
get-meteoalarm-warning-inc.php (980) ES_warnings: time spent: 0.8225 -  CURL OK for https://feeds.meteoalarm.org/api/v1/warnings/feeds-spain
Glad it's working for you again.
Title: Re: advisorybox does not work
Post by: meteosanjuan on March 27, 2024, 06:14:25 PM
Glad it's working for you again.

How great you are Ken, thanks to you for always being there.