NOAA RSS Advisory 2.0 PHP Script

It did change on its own now to say…

“Advisory Information Unavailable, error fetching data from the NOAA advisories server.”

So thats a good sign.

V2.00 03-Jun-2009 BETA .011

lots of code rearrangement - improvements

  • fixed error handling for when the NOAA servers are having problems. Soft failures are printed in html comments as usual. (hopefully I did not break stuff for when NOAA is working again)
  • fixed potential problem if NOAA servers fail while fetching fullMessages, it will fall back to $fullMessagesMode off so that it can still show the summary alert message instead of an error. (assuming you still have a valid summary alert message available.) Soft failures are printed in html comments as usual.
  • changes to simplify graceful_error function.

Here is an example of what you get if NOAA server is having a Mysql problem:

Your visitor sees:
“Advisory Information Unavailable, error fetching or reading data from the NOAA advisories server.”
Many times when an error like this happens there is a long delay while fetching, so the error is cached for your set cache interval.
Your visitor can refresh and there is no delay.

View the source of the HTML:

<div class="advisoryBoxnoactive"><!-- advisories.php - V2.00 03-Jun-2009 BETA .011 -->
<!-- using cached version from rss-advisory-2009-WAZ021.txt - age=23 secs. Next fetch in 577 secs. -->
<!-- Warning: cache file size = 90 is too small.. XML data not found. -->
<!-- Cache file HTML contents: Lost connection to MySQL server at 'reading initial communication packet', system error: 0 -->
<p>Advisory Information Unavailable, error fetching or reading data from the <a href="http://www.weather.gov/alerts-beta/wwaatmget.php?x=WAZ021">NOAA advisories server.</a></p>
<!-- zone=WAZ021 -->
</div>

Any time you want to troubleshoot a problem, view the source of the HTML

Edit: beta 11 has a problem, stay tuned for beta 12…

V2.00 03-Jun-2009 BETA .012

Fixed all known problems, all prior versions should be discarded. :lol:

Hi Mike getting this error on the newest beta:
Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home3/johnsto1/public_html/weather/rss-advisory-2009.php on line 326

Advisory Information Unavailable, error fetching or reading data from the NOAA advisories server.

I was getting that too every now and then. But i think it has more to do with the NWS having problems, rather than the script itself.

Seen that if i delete the txt file that it creates, then it works but doing a refresh on the page the error hits every time.

Like right now. My page just had it again. When I refresh it goes away. Then If i go back in 5 mins, it could be there again. The NWS has been having problems since early this morning, and still are. i really think “could be wrong” that its on there end thats causing the issues were seeing.

It is related to the server problems NOAA is having. I have already fixed that error on my next version to be released in a few minutes.

V2.00 03-Jun-2009 BETA .013

fixed all reported errors, all prior versions should be discarded. :lol:

Ok working good here, as in that error no longer there. Now have to wait for NOAA to fix there issue.

The latest works good Mike. My Advisory Is showing now that NOAA is back up.

http://www.snoqualmieweather.com/wxtest.php

Does it bother you that the title just says:
“Heat Advisory”

The old version it would say:
Heat Advisory - East Puget Sound Lowlands (Washington)

Should I try to fix that? Anybody?

I think it would be nice If it gave a little more detail where the adisory was. I like it now, But If you want to change it, I’d go for that too. Thanks for all the time you’ve put into this.

Well I think some may be used to the old way, then when they install the new script they will ask why it is different. Maybe I will add the feature as configurable an option.

Apparently this does not cover Short Term Forecasts, because this is showing it:
http://www.weather.gov/alerts/pa.html#PAZ066.CTPNOWCTP.221300

and this does not:
http://www.weather.gov/alerts-beta/wwaatmget.php?x=PAZ066

I wonder if it will cover the air quality alerts?

It does usually show Short Term Forecasts. They did have servers broken for most of the day so that might explain the omission.

Here is a national list of current alerts:
http://www.weather.gov/alerts-beta/us.php?x=1

Got a severe thunderstorm watch out for my county but it’s showing “There are no active watches, warnings or advisories for zone WVZ053.” This can be seen at http://www.harpersferry-weather.com/wxadvisory-2009.php. (use orange wide screen). The rrs-advisory-WVZ053.txt shows Jefferson County (WVZ053) with Severe Thunderstorm Watch.

The older rrs script shows the Severe Thunderstorm Watch at the top of my main page and also got the menu bar script showing the severe thunderstorm watch.

John

If an alert just came out, your cache file might not see it until the next refresh. you can force a refresh like this:
rss-advisory-2009.php?cache=refresh

It’s showing now. The watch had been out for quite awhile but I did a reboot of computer and now it’s showing.

Question though. In the rrs-advisory-2009.php I specified that the detailed report page is wxadvisory-detailed-2009.php but when I click on the link it goes to wxadvisory page.

I have $hurlURL = ‘wxadvisory-detailed-2009.php’

John

You are probably right about it being related to the earlier problems, it is showing now.