NWS Public Alert Messenger PHP Script
(old title) NOAA Top Weather Advisory Alerter PHP Script by Mike ChallisVersion: 1.16 - 28-Oct-2009
- NWS recently added County codes in addition to Zone codes.
Changed code to allow Zone or County codes.Version: 1.15 - 09-Sep-2009
- Added setting
// normally when the Advisory is canceled or expires, and the cache is updated,
// it sends out email/text alert stating "There are no active watches, warnings or advisories".
// disable this?
$disable_expired_message = false; // change to true to disable alert ended alert Version: 1.14 - 02-Sep-2009
- Fixed zone name twice in alert message, and more improved top alert selection. Version: 1.13 - 01-Sep-2009
- Fixed error when Air Quality Alert, improved top alert selection.
If it cannot figure out which alert is the top most alert, it will select the 1st one.Version: 1.12 - 31-Aug-2009
- If you have one of the rss-asvisory.php or rss-top-warning.php script that is pre version 2.00
the cache file could conflict with the other script.
If this condition is detected, the script will output: "Advisory Information Unavailable, cache file conflict, view source for details."
If you view the source you will see more details about the cause and how you can fix it (upgrade your other scripts to 2.00 or higher, or rename the $cacheName setting to something other than rss-advisory.txt).Version: 2.00 - 13-Jun-2010
- added OAuth/Twitter authentication (TweetWX642) because user/password authentication is being disallowed after June 30th, 2010 (Thanks to Joe Chung and Ken True for providing the auth code) Version: 2.10 - 15-Mar-2010
- Updated weather.gov feed URL
(new title)NWS Public Alert Messenger PHP Script by Mike Challis
(old title)NOAA Top Weather Advisory Alerter PHP Script by Mike ChallisPartially based on a variation of the following scripts:
RSS Top Warning PHP Script by Ken True http://saratoga-weather.org/scripts.php
PHP NOAA Advisory Text by Tom Chaplin http://www.carterlake.org/weatherphp.php
warnscroll.php by Jim McMurry - http://jcweather.us
Twitter Code from http://morethanseven.net/2007/01/20/posting-to-twitter-using-php/ What does it do?
Ever want to receive severe weather alerts by cell phone, blackberry, Twitter, or email? now you can.
This PHP script checks the NOAA RSS Weather Alert feeds on a timed schedule, then messages you if an alert status changes in the zone you have set.
The alert message is short enough to send to a cell phone, blackberry, or email.
Twitter is also optionally supported. Supports sending messages by email and Twitter.
Includes most of the features of the NOAA RSS Top Warning 2009 PHP Scripthttp://www.weather-watch.com/smf/index.php/topic,40256.0.htmlWhat do I need?
PHP 5 is required
.. Web server hosting account with PHP support and ability to send emails from PHP
.. Ability to schedule a cron job or a scheduler program on your PC
that can request a URL every 15 minutes.
.. your PHP server must allow PHP scripts permission to write files. safe_mode is recommended to be offHow to use it:
1) Set your settings in the "settings" section in the script
Be sure to set the NOAA zone and your email address.
Set all the settings for Email and Twitter, each method can be enabled or disabled.
2) Upload the php file to your web server
3) Test from a URL, see if you can see the output
see readme.txt for more info
Live Demo : www.642weather.com/weather/rss-weather-alerter.php