WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Topic started by: Curly on June 15, 2008, 06:24:47 PM

Title: Local Storm Report
Post by: Curly on June 15, 2008, 06:24:47 PM
NOAA provides a Local Storm Report (LSR) that lists the current storm events reported. They update frequently during a storm, page by page, and then they consolidate all reports after the storm. Not all NOAA web pages list this feature.

After a little beta testing, I have created an easier to read script that will show the reports for your area plus a menu for other locations. It's XHTML 1.0 Strict!
Maybe this is something you can use...

Local Storm Report http://www.weather.ricksturf.com/scripts/NOAAreport.zip (http://www.weather.ricksturf.com/scripts/NOAAreport.zip)

Let me know if you find any errors or have any question.

Curly


Note: This is for the US only
Title: Re: Local Storm Report
Post by: tweatherman on June 16, 2008, 08:07:28 AM
Very nice Curly... I will add it to my favorites.

Thanks,
Tim
Title: Re: Local Storm Report
Post by: katlon on June 16, 2008, 11:08:04 AM
Curly
Good job. Thanks for the script. I edited it for just my region instead of entire US.
The final product is at: http://pulliamjr.com/php/NOAAreportSrc5.php (http://pulliamjr.com/php/NOAAreportSrc5.php)

Lonnie
Title: Re: Local Storm Report
Post by: Curly on June 16, 2008, 06:15:35 PM
Thanks all !

Sorry to say, I just spotted a bug in one of the reports.  #-o   After 3 weeks of testing the script, one showed up today.
If a report is issued and is not kept in format, it throws everything off by a line. I'll work on a bug remover tonight and will have it posted later on this evening.

Curly

Title: Re: Local Storm Report
Post by: Curly on June 16, 2008, 08:31:39 PM
The script is updated to accept a blank line that is entered in the remarks. That blank line breaks the page format and it may be the only occurance. If it happens again, that base is covered.

One line has been added.

On line 41 and 42 you will see this
Quote
$year = date("Y");
$html = implode('', file($noaasr));

Add this line directly below it
Quote
$html = preg_replace("/(\n)( \s\s+)([A-Z])(.*)(\n)(\n)( \s\s+)/", '${1}${2}${3}${4}${5}${7}', $html);

Sorry for the inconvenience.

   Curly

Title: Re: Local Storm Report
Post by: jketcham on June 29, 2008, 07:52:38 AM
Doesn't work, the only thing I get when I put it on my site was There are errors in the page format
Title: Re: Local Storm Report
Post by: Curly on June 29, 2008, 01:29:46 PM
I'm working on it and giving it a thorough test.
Title: Re: Local Storm Report
Post by: Curly on June 29, 2008, 03:45:07 PM
All known issues have been corrected that have been pointed out.

There a several changes to accomodate the way some offices format their page. An extra line or two here, one missing there...
You can now add the complete script to your page without dissecting it, or you can just include it.

The original script should be replaced with this new one even though your not having any problems. The links are the same that are posted in the first message.

Thanks for your patience.

Curly
Title: Re: Local Storm Report
Post by: Carson Weather on June 30, 2008, 12:33:47 PM
Spiffy!
Now when I make my (infrequent) reports to NWS, I won't have to hunt around and see if they quoted me- "Nice weather was reported by trained spotter in Carson City"   :-P

http://www.carsonweather.com/storms.htm
Thanks for you effort!

Title: Re: Local Storm Report
Post by: Carson Weather on January 02, 2009, 12:02:58 PM
Curly,

The script appears (your site and mine) to have stopped working.
Did NWS give us a New Year surprise??

"There are errors in the page format
View the original page "
Title: Re: Local Storm Report
Post by: Curly on January 02, 2009, 01:43:51 PM
Uh oh.

Strange things have been happening at various NWS locations the last several days.  The weather story has been off and on too.

I'll give it a day or two and see if there are any changes.
Title: Re: Local Storm Report
Post by: ALITTLEweird1 on January 02, 2009, 02:12:05 PM
Mine appears to be working..Im running both scripts on the same page..

http://www.snoqualmieweather.com/storm_report.php
Title: Re: Local Storm Report
Post by: Curly on January 02, 2009, 02:46:12 PM
Oh no...


I'll work on it this weekend. Hope they don't suprise us with a new forecast.


Curly
Title: Re: Local Storm Report
Post by: Curly on January 03, 2009, 12:14:12 AM
Fixed it !

You can fix it by finding this
Code: [Select]
$year = date("Y");
$html = implode('', file($noaasr));

and replace it with this
Code: [Select]
$year = date("Y");
$html = implode('', file($noaasr));
// show last years reports
preg_match_all('|([0-9][0-9]/[0-9][0-9]/)(.*)(\s)|Uis', $html, $lastyear);
$preyear = $lastyear[2][0];
if($preyear == date("Y")-1) {
$year = date("Y")-1;
}


Or download the complete file
Local Storm Report http://www.weather.ricksturf.com/scripts/NOAAreport.zip


Curly
Title: Re: Local Storm Report
Post by: prvrt on January 03, 2009, 01:45:11 AM
I installed this script, works nice. I did notice I can not get the right background behind it like my other pages. I am sure it is something I am doing wrong. Also, if there are more than 7 reports, the rest of the reports move over to the left. Again, I think this has to do with me and how I put it into my website. I will play with it a bit more and see if I can get things to look more the same. Here is the url-->http://www.myidahoweather.com/NOAAreport.php (http://www.myidahoweather.com/NOAAreport.php) If any one has time to give me a few pointers I would appreciate it. I am by no means a programmer of any kind.

Thanks again for a nice script.

EDIT:I figured out how to get the background correct and also the alignment right. Trial and error does work at times.
Title: Re: Local Storm Report
Post by: Curly on January 03, 2009, 07:49:17 AM
Quote
if there are more than 7 reports, the rest of the reports move over to the left.
The alignment is now fixed in the script.

Quote
Trial and error does work at times.
No argues there!  Determination is the key for results.   :lol:

Thanks!
Curly
Title: Re: Local Storm Report
Post by: gulfbreeze on December 24, 2012, 08:49:36 PM
EDIT:I figured out how to get the background correct and also the alignment right. Trial and error does work at times.

What did you do to align the page correctly, I'm having the same problem, after the first 3 everything is shifted to the left.

Thanks, & Happy Holidays,
Doug
Title: Re: Local Storm Report
Post by: Maumelle Weather on December 24, 2012, 10:36:18 PM
Does anyone have a copy of this script by chance?  I would like to get one, if possible.

Thanks and Merry Christmas,

John
Title: Re: Local Storm Report
Post by: Curly on December 25, 2012, 10:33:09 AM
I've updated the script to take care of alignments and errors.
This is a complete web page for the Saratoga Base - USA template only.
If you don't use the template set, email me.

There is only one setting near the top of the file that you set to your nearest Weather Forecast Office.
$noaa_id = "iwx";  // Three letter code for YOUR nearest NOAA center

Local Storm Report http://www.weather.ricksturf.com/scripts/NOAAreport.zip (http://www.weather.ricksturf.com/scripts/NOAAreport.zip)
Title: Re: Local Storm Report
Post by: Maumelle Weather on December 25, 2012, 10:49:00 AM
Thank you very much, Curly!!!  Have it running here:  LSR Reports (http://sacrey.info/wxLSRreports.php)

Merry Christmas,

JOhn
Title: Re: Local Storm Report
Post by: prvrt on March 03, 2016, 12:05:19 AM
Just curious if there are any updates to this script as I am starting to get errors.
Title: Re: Local Storm Report
Post by: Curly on March 03, 2016, 04:42:44 AM
I've been working on an update and it should be available next week.
Title: Re: Local Storm Report
Post by: Curly on March 06, 2016, 07:56:13 PM
UPDATED !

http://www.weather.ricksturf.com/scripts/NOAAreport.zip
Title: Re: Local Storm Report
Post by: ALITTLEweird1 on March 06, 2016, 09:06:15 PM
Works great... Thanks Curly.
Title: Re: Local Storm Report
Post by: AWL on March 06, 2016, 09:30:05 PM
Works great... Thanks Curly.

I agree!  Thanks for not only this update but all the great scripts you have given all of us to use over the years!

Doug
Title: Re: Local Storm Report
Post by: gwwilk on March 07, 2016, 06:14:42 PM
I used 'Compare-It!' to bring all the changes from your new version into my old version and I blew right past that line without seeing it! :oops: The error was mine.  My gratuitous post deleted, Curly.

Title: Re: Local Storm Report
Post by: miraculon on March 08, 2016, 08:40:14 AM
This is a nice script. I added it to my site as well.
http://www.rogerscityweather.com/wxLSRreports.php (http://www.rogerscityweather.com/wxLSRreports.php)
There is a storm report still showing from 3/6. Is this a function of NWS or is there some kind of cache that is keeping it?
Do they eventually clear from showing once they get to a certain "age"?

Greg H.
Title: Re: Local Storm Report
Post by: Curly on March 08, 2016, 11:01:41 AM
The NWS usually keeps the reports for several days and then the reports will dwindle down to none.
The script does not cache any data as it gets the latest data from the NWS at each page view.
If you click on NWS Local Storm Reports at the top of the page, it will take you to the NWS LSR page.

I did a minor update to the script early this morning to fix the El Paso WFO and to remove unwanted characters from  the Dallas WFO page format.
Title: Re: Local Storm Report
Post by: Curly on March 09, 2016, 07:35:04 PM
UPDATED TO A NEW VERSION

Fixed a stray html markup that sometimes appears AND added the choice of a drop down menu for the locations OR a clickable map.
The 2 settings are in the script where you enter your WFO code. Since this is new, the file name has changed from the past version.
This is for the Continental US only.

For the Saratoga Base template:  http://www.weather.ricksturf.com/scripts/wxLSRreports2.zip
Standard script to include in a web page:  http://www.weather.ricksturf.com/scripts/LSRreports_inc.zip
Title: Re: Local Storm Report
Post by: gwwilk on March 10, 2016, 11:12:51 AM
Thanks, Curly!  The clickable map is a nice feature that keeps the display interesting especially when there are no LSR's available.  I've modified this new Saratoga templated Local Storm Report to use both the map and the drop down as selection options (http://www.gwwilkins.org/wxLSRreports2.php), which is obviously my preference.  Others may disagree, of course.  In addition I've added the self-downloader (http://www.gwwilkins.org/wxLSRreports2.php?sce=view) in case anyone is interested in my hacked version.

Great job, as usual, Curly. =D>
Title: Re: Local Storm Report
Post by: Cutty Sark Sailor on March 11, 2016, 09:10:05 AM
wxLSRreports2.php typo?
-Check the image map coords code for "Charleston, WV"... abt line 804
should be "href="?i=rlx"...
not
href="?i= er/rlx"  :-k

ok in 'inc' template, far as I see so far.
Title: Re: Local Storm Report
Post by: miraculon on March 11, 2016, 09:18:53 AM
The same goes for Raleigh, NC (line 806) and Morehead City, NC (line 807).

Greg H.
Title: Re: Local Storm Report
Post by: ValentineWeather on March 11, 2016, 10:03:25 AM
Thanks Curly, very nice job.
Title: Re: Local Storm Report
Post by: Cutty Sark Sailor on March 11, 2016, 11:47:41 AM
wxLSRreports2.php typo?
-Check the image map coords code for "Charleston, WV"... abt line 804
should be "href="?i=rlx"...
not
href="?i= er/rlx"  :-k

ok in 'inc' template, far as I see so far.
The same goes for Raleigh, NC (line 806) and Morehead City, NC (line 807).

Greg H.

also in reports2 map
line 777 change "Tallahassee FL" from 'tlh' to 'tae'

Title: Re: Local Storm Report
Post by: Cutty Sark Sailor on March 12, 2016, 12:57:11 PM
Hmmm... decided I didn't really care for
this map...   :-"  (e.g. thumbail)
1
(http://frankfortweather.us/zonked/THcwa2.gif)

...decided to play with this concept (e.g. thumbnail)   8-[
2
(http://frankfortweather.us/zonked/THusnws_white.jpg)

And have this testing (e.g. thumbnail) currently
3
(http://frankfortweather.us/zonked/THusnws642cr.jpg)
at http://frankfortweather.us/wxLSRreports4.php

Attached is the simple code change, and a few
of #2 various types, as well as #3 you're welcome to, if you choose...

You can photoshop those basic images of course, but the size and dimensions
of the image, and the image content perspective must remain the same,
or the mapping links will be displaced.

Mike
Title: Re: Local Storm Report
Post by: gwwilk on March 12, 2016, 01:22:02 PM
Tom Abell has found a map that registers fairly well with the polygonal coordinates and has incorporated it into a modified version.

You can see the template version on my site here (http://www.gwwilkins.org/wxLSRreports2tab.php) and the stand alone here (http://www.gwwilkins.org/LSRreports_inc.php).  Be aware that both the map and the drop down list are active in these versions.

Those of you who are enterprising can use '?sce=view' to acquire the code and R-click on the map then 'save Image as...' to get the map.
Title: Re: Local Storm Report
Post by: jgillett on March 13, 2016, 01:58:56 AM
Swiped! Thank you, Jerry...

http://tiggrweather.net/wxLSRreports2tab.php
Title: Re: Local Storm Report
Post by: Breezy on March 27, 2016, 09:18:41 AM
Thanks Rick and Jerry. Much appreciated !!!  =D>

Jeff
Title: Re: Local Storm Report
Post by: mikeym2m on March 28, 2016, 09:52:44 AM
Thanks Rick and Jerry   \:D/

Cheers

 :-)

MikeyM
Title: Re: Local Storm Report
Post by: stormwatch on April 01, 2016, 06:31:45 PM
Thanks Curly for an outstanding script as always!!! :grin:
Title: Re: Local Storm Report
Post by: Gregal on September 04, 2017, 07:05:58 PM
Would someone post the template site as the links to the original seems to be broken.

Thank you
Title: Re: Local Storm Report
Post by: gwwilk on September 04, 2017, 08:29:40 PM
Would someone post the template site as the links to the original seems to be broken.

Thank you
See my post above here (http://www.wxforum.net/index.php?topic=1785.msg282180#msg282180).