WXforum.net
Web Weather => Weather Website PHP/AJAX scripting => Topic started 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
-
Very nice Curly... I will add it to my favorites.
Thanks,
Tim
-
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
-
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
-
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
$year = date("Y");
$html = implode('', file($noaasr));
Add this line directly below it
$html = preg_replace("/(\n)( \s\s+)([A-Z])(.*)(\n)(\n)( \s\s+)/", '${1}${2}${3}${4}${5}${7}', $html);
Sorry for the inconvenience.
Curly
-
Doesn't work, the only thing I get when I put it on my site was There are errors in the page format
-
I'm working on it and giving it a thorough test.
-
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
-
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!
-
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 "
-
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.
-
Mine appears to be working..Im running both scripts on the same page..
http://www.snoqualmieweather.com/storm_report.php
-
Oh no...
I'll work on it this weekend. Hope they don't suprise us with a new forecast.
Curly
-
Fixed it !
You can fix it by finding this
$year = date("Y");
$html = implode('', file($noaasr));
and replace it with this
$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
-
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.
-
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.
Trial and error does work at times.
No argues there! Determination is the key for results. :lol:
Thanks!
Curly
-
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
-
Does anyone have a copy of this script by chance? I would like to get one, if possible.
Thanks and Merry Christmas,
John
-
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)
-
Thank you very much, Curly!!! Have it running here: LSR Reports (http://sacrey.info/wxLSRreports.php)
Merry Christmas,
JOhn
-
Just curious if there are any updates to this script as I am starting to get errors.
-
I've been working on an update and it should be available next week.
-
UPDATED !
http://www.weather.ricksturf.com/scripts/NOAAreport.zip
-
Works great... Thanks Curly.
-
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
-
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.
-
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.
-
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.
-
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
-
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>
-
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.
-
Thanks Curly, very nice job.
-
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'
-
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
-
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.
-
Swiped! Thank you, Jerry...
http://tiggrweather.net/wxLSRreports2tab.php
-
Thanks Rick and Jerry. Much appreciated !!! =D>
Jeff
-
Thanks Rick and Jerry \:D/
Cheers
:-)
MikeyM
-
Thanks Curly for an outstanding script as always!!! :grin:
-
Would someone post the template site as the links to the original seems to be broken.
Thank you
-
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).