cloudy cloudy

Author Topic: NOAA RSS Advisory 2.0 PHP Script  (Read 54046 times)

0 Members and 1 Guest are viewing this topic.

abaldish

  • Guest
Re: NOAA RSS Advisory 2009 PHP Script (Beta)
« Reply #30 on: June 03, 2009, 05:23:39 AM »
Yea i would have to agree the first one is better.
Got it up and running now on one of the main pages.

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 5,155
  • North Bend, WA
    • North Bend Weather
Re: NOAA RSS Advisory 2009 PHP Script (Beta)
« Reply #31 on: June 03, 2009, 11:36:40 AM »
Agree... The first one.
"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 5,155
  • North Bend, WA
    • North Bend Weather
Re: NOAA RSS Advisory 2009 PHP Script (Beta)
« Reply #32 on: June 03, 2009, 12:53:14 PM »
Seems like the beta isn't picking up our Local Heat Advisory. Not unless I missed a setup somewhere.

http://www.weather.gov/alerts/wa.html#WAZ505.SEWNPWSEW.100500

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


This is from my View Source...

Code: [Select]

<div id="main-copy">
<div class="advisoryBoxnoactive"><!-- wxtest.php - V2.00 02-Jun-2009 BETA .009 -->
<!-- getting new file from http://www.weather.gov/alerts-beta/wwaatmget.php?x=WAZ505 -->
<!-- CURL GET /alerts-beta/wwaatmget.php?x=WAZ505 HTTP/1.0 Host: www.weather.gov -->
<!-- CURL Network error: Operation timed out with 0 out of -1 bytes received -->
<!-- CURL Network error: Operation timed out with 0 out of -1 bytes received -->
<!-- Time to fetch: 24.154 sec -->
<!-- HTML fetch length = 0 ; Cache not saved. -->
<!-- headers n/a -->
There are no active watches, warnings or advisories for zone WAZ505.</div>
    <p> </p>
</div><!-- end main-copy -->


But it also looks like the NWS could be having some problems, cause the original advisory isnt working either at the present time. 
Quote
Advisory Information Unavailable, error reading RSS Data saved from the NOAA advisories server.
« Last Edit: June 03, 2009, 12:56:34 PM by ALITTLEweird1 »
"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam

Offline MCHALLIS

  • Posts: 2,158
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: NOAA RSS Advisory 2009 PHP Script (Beta)
« Reply #33 on: June 03, 2009, 04:18:03 PM »
The NWS is having some problems today. This is a good opportunity for me to work on error handling.

I see a problem with what you posted because in this scenario it should not print "There are no active watches, warnings or advisories for zone WAZ505." It should print: "Advisory Information Unavailable, error fetching data from the NOAA advisories server."

Code: [Select]
<!-- rss-advisory-2009.php - V2.00 02-Jun-2009 BETA .011 -->
<!-- getting new file from http://www.weather.gov/alerts-beta/wwaatmget.php?x=WAZ021 -->
<!-- CURL GET /alerts-beta/wwaatmget.php?x=WAZ021 HTTP/1.0 Host: www.weather.gov -->
<!-- Time to fetch: 20.689 sec -->
<!-- HTML fetch length = 52 ; Cache not saved. -->
<!-- Headers received: n/a -->
<!-- HTML received: Can't connect to MySQL server on 'mysql-cluster' (4) -->
<p>Advisory Information Unavailable, error fetching data from the <a href="http://www.weather.gov/alerts-beta/wwaatmget.php?x=WAZ021">NOAA advisories server.</a></p>

<!-- Zone='WAZ021' -->


I almost have it all fixed on my development server ...new beta coming soon.

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 5,155
  • North Bend, WA
    • North Bend Weather
Re: NOAA RSS Advisory 2009 PHP Script (Beta)
« Reply #34 on: June 03, 2009, 04:31:24 PM »
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.





"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam

Offline MCHALLIS

  • Posts: 2,158
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: NOAA RSS Advisory 2009 PHP Script (Beta)
« Reply #35 on: June 03, 2009, 05:38:43 PM »
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:
Code: [Select]
<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....

« Last Edit: June 03, 2009, 05:55:37 PM by MCHALLIS »

Offline MCHALLIS

  • Posts: 2,158
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: NOAA RSS Advisory 2009 PHP Script (Beta)
« Reply #36 on: June 03, 2009, 06:39:43 PM »
V2.00 03-Jun-2009 BETA .012

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

abaldish

  • Guest
Re: NOAA RSS Advisory 2009 PHP Script (Beta)
« Reply #37 on: June 03, 2009, 07:04:34 PM »
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.


Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 5,155
  • North Bend, WA
    • North Bend Weather
Re: NOAA RSS Advisory 2009 PHP Script (Beta)
« Reply #38 on: June 03, 2009, 07:06:46 PM »
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.
"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam

abaldish

  • Guest
Re: NOAA RSS Advisory 2009 PHP Script (Beta)
« Reply #39 on: June 03, 2009, 07:11:41 PM »
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.

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 5,155
  • North Bend, WA
    • North Bend Weather
Re: NOAA RSS Advisory 2009 PHP Script (Beta)
« Reply #40 on: June 03, 2009, 07:17:35 PM »
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.
"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam

Offline MCHALLIS

  • Posts: 2,158
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: NOAA RSS Advisory 2009 PHP Script (Beta)
« Reply #41 on: June 03, 2009, 07:23:29 PM »
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.



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.

Offline MCHALLIS

  • Posts: 2,158
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: NOAA RSS Advisory 2009 PHP Script (Beta)
« Reply #42 on: June 03, 2009, 07:29:09 PM »
V2.00 03-Jun-2009 BETA .013

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

abaldish

  • Guest
Re: NOAA RSS Advisory 2009 PHP Script (Beta)
« Reply #43 on: June 03, 2009, 08:16:54 PM »
Ok working good here, as in that error no longer there. Now have to wait for NOAA to fix there issue.

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 5,155
  • North Bend, WA
    • North Bend Weather
Re: NOAA RSS Advisory 2009 PHP Script (Beta)
« Reply #44 on: June 03, 2009, 10:36:00 PM »
The latest works good Mike. My Advisory Is showing now that NOAA is back up.

http://www.snoqualmieweather.com/wxtest.php
"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam

 

cumulus