Guys:
I found a great new Weather Script on the net. It's actually a Universal PHP RSS Reader that I configured to read the NOAA Alerts RSS Feed, but it can be configured for any weather related RSS feed (or non-weather related, of course).
There are two versions of the Script and you can try both at the same time. As I configured it (see below), the first Script, ("pscroller1"), will vertically scroll the RSS "Items" for a given NWS Zone, in my case, MDZ006. You can easily change the zone by simply copying the URL for the RSS for your zone by finding the URL at
http://www.weather.gov/alerts/ and then configuring the PHP setup pages that come with the Script. So for this script, I get the headlines "Severe Thunder Storm Warning", 'Special Weather Statement", etc. for my zone, and that's it (no Description), but they scroll very cleanly and "snappy" one at a time in the display box. It's very neat.
The second Script, ("pscroller2"), will vertically scroll the RSS "Item"
and "Description" for a given NWS Zone. So for this script, I get the headlines and the descriptions / text for the "Severe Thunder Storm Warning", 'Special Weather Statement", etc. The 'rub' is that they scroll one at a time - and PAUSE for each one for a configurable time - in the display box. It's VERY neat.
Here is the script:
http://www.dynamicdrive.com/dynamicindex17/rsspausescroller/index.htmHere are the instructions:
1. Download the zip file on that web page.
2. Follow the instructions step by step - carefully - on that web page. Be sure to put ALL the zipped files and sub-directories in the same directory in your webserver. In other words, There is one HTM page ("demo.htm") and one file ("rsspausescroller.js") that you place in your webserver directory, but you also place the subdirectory ("lastrss"), just like it is, in the same webserver directory. That subfolder has two PHP pages and an additional cache subfolder which will copy over when you place the files in your webserver.
3. Load up the demo.htm and be sure it works properly. If it does not, check the directions on the web page above again. It worked for me the first time.
4. OK, so now you see how it works and you need to configure it for NOAA RSS. Go here: http://www.weather.gov/alerts/ and then in the THIRD column where it says "RSS 'By County/Zone'" you click the orange XML button for your state. Next, click on your county. When the RSS feed displays in your browser, highlight and copy the URL link.
5. Back at your webserver, edit the PHP file "scrollerbridge.php" in the "lastrss" subdirectory.
6. You will see some code that looks like this:
// Define your list of RSS URLs- "RSS_id"=> "URL to RSS feed"
$rsslist=array(
"cnn" => "http://rss.cnn.com/rss/cnn_topstories.rss",
"bbc" => "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml",
"news.com" => "http://news.com.com/2547-1_3-0-5.xml",
"slashdot" => "http://rss.slashdot.org/Slashdot/slashdot",
"dynamicdrive" => "http://www.dynamicdrive.com/export.php?type=new",
"WJZ" => "http://wjz.com/localbriefs/resources_genericrss.xml",
"NOAA" => "http://www.weather.gov/alerts/wwarssget.php?zone=WIZ046",
);
Notice the last line I added that starts "NOAA". You need to add this line, and insert the URL you copied as a replacement to what I inserted. Remember to add the comma after the last quote. Now close that page. You're done. You do not need to edit the other PHP file called "lastRSS.php".
7. Now go to the "demo.htm" page that come with the script and edit that page. You will find this code at the end of that page:
new rsspausescroller("NOAA", "pscroller1", "rssclass", 3000, "_new")
document.write("<br />") //add a divider for demo
new rsspausescroller("NOAA", "pscroller2", "rssclass", 3000, "", "date+description")
See how I adjusted the RSS feed to "NOAA" instead of whatever they had there (I think it was cnn)? Well, change this to NOAA. This now pulls the feed from what you just set up in "scrollerbridge.php".
8. Open up "demo.htm" in your browser. If there are no alerts for your area, I would suggest going back to
http://www.weather.gov/view/nationalwarnings.php?map=on and looking at our fine country, and work backwards to find some juicy warnings and watches and select that zone temporarily. I have gotten fairly good at this because warnings and watches change and can suddenly drop when the warning is over. Go back to "scrollerbridge.php" and just substitute the zone number (the rest of the URL stays the same) so you can see the script in action.
9. COOL, eh? But wait.... there's a problem. That is why I took the time to post this.

-------------
If you look at the Script (that shows the RSS "Description"), i.e., the second script, you will notice that it displays like this:
PROVIDENCE COUNTY IN RHODE ISLAND<br> SOUTHERN NORFOLK COUNTY IN EASTERN MASSACHUSETTS<br> THIS INCLUDES THE CITY OF FRANKLIN<br><br>* UNTIL 145 PM EDT<br><br>* AT 755 AM EDT RADAR INDICATES HEAVY RAIN WILL CONTINUE THROUGH AT<br> LEAST NOON BEFORE DIMINISHING BETWEEN 1 AND 4 PM. RAINFALL<br> OVERNIGHT ENDING AT 730 AM HAS AVERAGED 1 TO 2 INCHES ACROSS MUCH<br> OF PROVIDENCE COUNTY RHODE ISLAND AND SOUTHERN NORFOLK COUNTY.<br><br>* HEAVIEST RAIN SO FAR HAS OCCURRED FROM FOXBOROUGH TO PLAINVILLE<br> MASSACHUSETTS TO CUMBERLAND...LINCOLN...SMITHFIELD...WOONSOCKET<br> AND NORTH PROVIDENCE.<br><br>* THE HEAVY RAIN WILL CAUSE WIDESPREAD POOR DRAINAGE AND BASEMENT<br> FLOODING BY LATE THIS MORNING WITH SEVERAL STREAMS EXPECTED TO<br> RIDE OUT OF THEIR BANKS DURING MIDDAY.<br><br>* THE BLACKSTONE AND NORTH BRANCH OF THE PAWTUXET RIVERS WILL BE<br> RISING RAPIDLY DURING MIDDAY AND THIS AFTERNOON...THREATENING TO<br> FLOOD.<br><br>* ROAD CLOSURES MAY OCCUR BY LATE MORNING. IF ROADS BECOME<br> IMPASSABLE...DONT DRIVE AROUND BARRICADES. IT COULD BECOME<br> LIFE THREATENING.<br><br>* STORM TOTAL RAINFALL BY NOON IN PORTIONS OF NORFOLK AND<br> PROVIDENCE COUNTIES WILL PROBABLY EXCEED 4 INCHES...WITH 6 INCH<br> TOTALS POSSIBLE.<br><br>A FLOOD WARNING MEANS THAT FLOODING IS IMMINENT OR HAS BEEN REPORTED.<br>STREAM RISES WILL BE SLOW AND FLASH FLOODING IS NOT EXPECTED.<br>HOWEVER...ALL INTERESTED PARTIES SHOULD TAKE NECESSARY PRECAUTIONS<br>IMMEDIATELY.<br><br>LAT...LON 4177 7178 4176 7145 4197 7141 4210 7107<br> 4218 7132 4199 7149 4198 7178<br><br>$$<br><br><br>DRAG<br><a href=http://www.nws.noaa.gov/er/box/>Issuing Weather Forecast Office Homepage</a>Flood Watch - Southeast Providence (Rhode Island)
Dec 31, 1969 7:00:00 PM
Notice how this script is not 'reading' the line breaks in the RSS feed but just displaying the html instead? I want to make the script display the results better, i.e., literally enforce the line breaks or instead remove that html and have it flow better. Ideally, I want it to display just like it does with the "<pre>" html command....or the way it does when you read the page over IWIN, etc. so it looks 'normal' as I am used too the way I normally read it on the net.
So I AM NOT a PHP guy. I only tinker. After hours of bs-ing around to tinker with the script, I managed to get some progress - but then hit a dead end. At the end of the "scrollerbridge.php" page, I found this code:
function slas**t($what){ //Encode text for storing in JavaScript array
$newstring=str_replace(''', '\'', $what); //replace those half valid apostrophe entities with actual apostrophes
return rawurlencode($newstring);
I replaced that middle line (sloppy...but as a test and then ill add it 'in addition to' the middle line) with the following code:
$newstring=preg_replace("<br>", " ", $what); //replace those half valid apostrophe entities with actual apostrophes
Now, it displays like this:
PROVIDENCE COUNTY IN RHODE ISLAND<> SOUTHERN NORFOLK COUNTY IN EASTERN MASSACHUSETTS<> THIS INCLUDES THE CITY OF FRANKLIN<><>* UNTIL 145 PM EDT<><>* AT 755 AM EDT RADAR INDICATES HEAVY RAIN WILL CONTINUE THROUGH AT<> LEAST NOON BEFORE DIMINISHING BETWEEN 1 AND 4 PM. RAINFALL<> OVERNIGHT ENDING AT 730 AM HAS AVERAGED 1 TO 2 INCHES ACROSS MUCH<> OF PROVIDENCE COUNTY RHODE ISLAND AND SOUTHERN NORFOLK COUNTY.<><>* HEAVIEST RAIN SO FAR HAS OCCURRED FROM FOXBOROUGH TO PLAINVILLE<> MASSACHUSETTS TO CUMBERLAND...LINCOLN...SMITHFIELD...WOONSOCKET<> AND NORTH PROVIDENCE.<><>* THE HEAVY RAIN WILL CAUSE WIDESPREAD POOR DRAINAGE AND BASEMENT<> FLOODING BY LATE THIS MORNING WITH SEVERAL STREAMS EXPECTED TO<> RIDE OUT OF THEIR BANKS DURING MIDDAY.<><>* THE BLACKSTONE AND NORTH BRANCH OF THE PAWTUXET RIVERS WILL BE<> RISING RAPIDLY DURING MIDDAY AND THIS AFTERNOON...THREATENING TO<> FLOOD.<><>* ROAD CLOSURES MAY OCCUR BY LATE MORNING. IF ROADS BECOME<> IMPASSABLE...DONT DRIVE AROUND BARRICADES. IT COULD BECOME<> LIFE THREATENING.<><>* STORM TOTAL RAINFALL BY NOON IN PORTIONS OF NORFOLK AND<> PROVIDENCE COUNTIES WILL PROBABLY EXCEED 4 INCHES
See? It removes the "<BR>" but leaves the "<" and the ">".
If instead I use this code:
$newstring=preg_replace("<br>", "<p>", $what); //replace those half valid apostrophe entities with actual apostrophes
It will display like this:
PROVIDENCE COUNTY IN RHODE ISLAND<
> SOUTHERN NORFOLK COUNTY IN EASTERN MASSACHUSETTS<
> THIS INCLUDES THE CITY OF FRANKLIN<
><
>* UNTIL 145 PM EDT<
><
>* AT 755 AM EDT RADAR INDICATES HEAVY RAIN WILL CONTINUE THROUGH AT<
> LEAST NOON BEFORE DIMINISHING BETWEEN 1 AND 4 PM. RAINFALL<
> OVERNIGHT ENDING AT 730 AM HAS AVERAGED 1 TO 2 INCHES ACROSS MUCH<
> OF PROVIDENCE COUNTY RHODE ISLAND AND SOUTHERN NORFOLK COUNTY.<
><
>* HEAVIEST RAIN SO FAR HAS OCCURRED FROM FOXBOROUGH TO PLAINVILLE<
> MASSACHUSETTS TO CUMBERLAND...LINCOLN...SMITHFIELD...WOONSOCKET<
> AND NORTH PROVIDENCE.<
><
>* THE HEAVY RAIN WILL CAUSE WIDESPREAD POOR DRAINAGE AND BASEMENT
See?
I must be getting close here but, because I dont know the finer points of PHP, I cant get any further. I cant get the "<" and ">" to go away.
If anyone wants to tinker with this and suggest a code change, it sure would be appreciated. I did see on the other PHP page needed for the Script ("lastRSS.php") there is more code and at one point it talks about stripping html and other "bull[edit]" (it actually says it in there) and maybe thats where the tinkering should be....but that part is really confusing to me.
Good luck should you find yourself as close as me to perfection but not able to make the final step!!!!
Adam