WXforum.net
June 18, 2013, 11:18:53 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
Members: 6695  •  Posts: 181349  •  Topics: 18407
Please welcome KD0RII, our newest member.
Welcome to the the new hosting for WXforum.net.
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: PHP RSS for top NOAA warning display  (Read 2974 times)
0 Members and 1 Guest are viewing this topic.
saratogaWX
Administrator
Forecaster
*****
Offline Offline

Posts: 3783


Saratoga, CA, USA Weather - free PHP scripts


WWW
« on: November 07, 2007, 08:33:28 PM »

This script is thanks to Jim at jcweather.us who combined a bit of my rss-advisory-test-c.php and Tom's of Carterlake.org advisory.php script to create a new script that reads the RSS feed for Zone warnings from NOAA, caches the XML, and sorts through the output to display the most severe warning for the area (based on the following list with most intense condition at top):
 
  • Tornado Warning
  • Other Warning
  • Watch
  • Advisory
  • Special Statement
  • Short Term Forecast

The script works with the rss-advisory-test-c.php script to display either nothing (for no active advisories), or a color-coded box/text (styled by CSS) to display the message and a link to the page to display the details.

Thanks for the design work Jim!  I've added a few things to his script (and at his recommendation), posted the new script in the hope you might find it useful for your website too.

http://saratoga-weather.org/scripts-rss.php#topwarn

Best regards,
Ken
Logged

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP
capeweather
Administrator
Forecaster
*****
Offline Offline

Posts: 923



WWW
« Reply #1 on: November 10, 2007, 10:53:49 PM »

Thank you sir! I installed it last night and did a little tweaking to show an image next to the output. Very cool and easy to install! You da' man Ken.
Logged


Chris
Cape Coral, Florida
Website: http://www.capeweather.com
Website: http://www.fortmyersweather.net
saratogaWX
Administrator
Forecaster
*****
Offline Offline

Posts: 3783


Saratoga, CA, USA Weather - free PHP scripts


WWW
« Reply #2 on: November 10, 2007, 11:02:58 PM »

Thanks Chris, and thanks to Jim at jcweather.us for the script mashup in the first place  Very Happy

Best regards,
Ken
Logged

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP
jmcmurry
Jim McMurry
Senior Contributor
****
Offline Offline

Posts: 267


Davis Vantage Pro 2 Plus Wireless.


WWW
« Reply #3 on: November 11, 2007, 06:49:31 AM »

Thank you sir! I installed it last night and did a little tweaking to show an image next to the output. Very cool and easy to install! You da' man Ken.

Now that's a good idea!  - Jim
Logged

anchorageweather
Forecaster
*****
Offline Offline

Posts: 445



WWW
« Reply #4 on: November 12, 2007, 06:03:29 AM »

Thank to all who had a hand in this!!!!!!!
Logged

South of the Tracks, Anchorage, KY
anvana
Senior Member
**
Offline Offline

Posts: 98


WWW
« Reply #5 on: November 12, 2007, 04:18:00 PM »

Thanks for the handy script, Ken.

I've also discovered that this comes in handy for those of us who are along the coast where off-shore warnings and advisories are just as important as they land-based advisories. In our area of the southeast coast, the off-shore warnings and advisories are included with the regular, land-based zone advisories (Small Craft Advisory, Gale Warning, etc.). Some areas may or may not be including these together with the land-based advisories.

Your warning script also works for marine advisories with a slight modification.

First, you'll need to get your marine zone from the NWS. Marine zones are not normally listed with the land-based zones, so you'll need to do some investigative work. I found mine several weeks ago when marine warnings were being posted for Hurricane NOEL.

If you live in a coastal area, you'll need to monitor the raw RSS feed for your land-based zone. Look for any marine advisories or warnings that might be contained in the RSS feed and make note of the marine zone. For example, mine is AMZ252

In the original warning script, simply replace the land-based zone with the marine zone you just found. Rename the script to something different than the original - say rss-maring-warning.php - and upload to your server. Include the newly-named file in the page you want the marine warnings to appear and you're good to go.

You'll also need to change the zone parameter in the rss-advisory-test-c.php XML Parser script if you're using that script in conjunction with the warning script.

There is one little gotcha: If you modify this script for marine advisories and warnings and use the original land-based script on the same page, you will get a php error. To use both on the same page you will need to make one more change to the marine version before uploading.

There are two instances where forecastfetchURLWithoutHanging is stated in the original script. You will find them on lines 118 and 224. Append this function in the marine version of your script to "forecastfetchURLWithoutHanging2" (without the quotes, of course) in both places. You can now call both scripts on the same page without getting an error.

This all depends of course whether or not your local NWS includes marine warnings and advisories in the RSS feed. Not all do, but the NWS states that they are eventually going to include them in all their RSS feeds for advisories and warnings. If yours isn't available yet, just be patient.
Logged

Harryca
Senior Contributor
****
Offline Offline

Posts: 297


WWW
« Reply #6 on: November 12, 2007, 04:54:58 PM »

This all depends of course whether or not your local NWS includes marine warnings and advisories in the RSS feed. Not all do, but the NWS states that they are eventually going to include them in all their RSS feeds for advisories and warnings. If yours isn't available yet, just be patient.

That is good news.  Thanks for the info.  I have been wondering for a long time if the marine warnings and advisories were ever going to be added to the RSS feeds.
Logged

saratogaWX
Administrator
Forecaster
*****
Offline Offline

Posts: 3783


Saratoga, CA, USA Weather - free PHP scripts


WWW
« Reply #7 on: November 12, 2007, 05:33:20 PM »

Thanks Joe for the tip on marine advisories!  I'm sure the folks along coasts (inland and marine) will find it very helpful.

Best regards,
Ken
Logged

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP
Curly
Forecaster
*****
Offline Offline

Posts: 477


WWW
« Reply #8 on: November 13, 2007, 06:53:54 PM »

I found this map that will zoom in on the coastal waters and show the zone number.
http://www.nws.noaa.gov/om/marine/zone/usamz.htm
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.106 seconds with 18 queries.
anything