Author Topic: WXUSALERTS Clickable Alerts Map Script  (Read 20419 times)

0 Members and 1 Guest are viewing this topic.

Offline tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #75 on: March 20, 2014, 02:25:03 PM »
In the worst case, I can re-draw the map coordinates as painstaking as that would be!

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #76 on: March 20, 2014, 02:28:31 PM »
In the worst case, I can re-draw the map coordinates as painstaking as that would be!

If you take that route, let us have a peek at your finished work, OK?
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #77 on: March 20, 2014, 02:39:17 PM »
Will do!  But... It will take a while!

Offline Maumelle Weather

  • Forecaster
  • *****
  • Posts: 1827
    • Maumelle Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #78 on: March 26, 2014, 08:18:00 AM »
Jerry and All,

I've noticed that the NWS has changed some colors in regards to the Freeze Watch/Warnings that are currently in effect, but the color changes do not show up on their FAQ page, nor have I seen any mention of this. I wonder what others have been changed?

John
GR2AE, GR3, Cumulus

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #79 on: March 26, 2014, 08:51:05 AM »
Jerry and All,

I've noticed that the NWS has changed some colors in regards to the Freeze Watch/Warnings that are currently in effect, but the color changes do not show up on their FAQ page, nor have I seen any mention of this. I wonder what others have been changed?

John
Right you are, John.  It seems as though we have a right hand <=> left hand communication problem.  After they sort it out, I'll make the changes.  For now, just drilling down on the map gives the necessary information and the color table with the map currently complies with their 'official' FAQ's information.

Well, I've relented.  A new alert code is in effect today, 'Coastal Flood Warning'.  It has been added to wxusalerts6.zip and the NWS modifications to the freezing weather codes have been incorporated.  They had overloaded the #00FFFF color and I think they are correcting the problem.  Time will tell.
« Last Edit: March 26, 2014, 09:38:54 AM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #80 on: March 26, 2014, 12:20:38 PM »
There was an error in wxusalerts6.zip's validation.  This has been corrected in wxusalerts6a.zip.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #81 on: April 14, 2014, 09:32:25 AM »
The NWS has made further undocumented color changes to the freezing weather codes.  These are incorporated into wxusalerts6b.zip above
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #82 on: April 14, 2014, 03:42:41 PM »
I have been encouraged to come up with a display of only those legend items that are currently in use.  After considerable reluctance I decided to try it, and the project wasn't nearly as difficult as I had imagined.

The advvorecast2.php script contains routines similar to those needed for this project.  The php strpos() function was all that was necessary after I borrowed the 'fetchUrlWithoutHanging()' routine from there.  The display required tweaking, as did the text.  There is no longer any reason to toggle the legend.

One potential show-stopper for those who are sticklers for w3c validation is that because the NWS uses duplicate color ID's, the script more often than not fails validation because of this.  Checking the NWS page where the alerts map appears, their main page www.weather.gov, shows 314 validation errors, so they're obviously not too concerned with the standards.  Nevertheless on my page I have loaded my failsafe footer, 'footer-invalid.php' where no W3C compliant stickers or links appear.  Personal choice, I guess.

The attached 'wxusalerts-all.zip' contains 'wxusalerts-all.php' and 'wxusalerts-all.css' in order to differentiate this script from the original.  Renaming 'wxusalerts-all.php' to 'wxusalerts.php' prior to uploading both files to your site is all that should be necessary in order to swap the new script into your menu system.

Regards, Jerry Wilkins
gwwilk@gmail.com

Offline tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #83 on: April 14, 2014, 03:51:55 PM »
Shame on whomever put you up to that  :lol:

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #84 on: April 14, 2014, 04:05:13 PM »
Shame on whomever put you up to that  :lol:
And the unrepentant culprit appears forthwith! :grin:
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #85 on: September 15, 2015, 05:36:11 PM »
This script's latest version fell over this morning when the Legend no longer displayed.  It turns out that the NWS has instituted a policy that requires a 'user agent' when fetching URL's.  I borrowed and modified slightly 'QJ_fetchUrlWithoutHanging' from Ken True's 'quake-json.php', then put it into play.  The Legend now displays again!  Thanks, Ken.  =D&gt;

The source is available by right-clicking here, selecting 'Save as...' and saving without the '.txt'.  Be aware that the NWS repeats color ID's in their legend, so W3C validation produces errors.  I've disabled the W3C links by creating a 'footer-invalid.php' that this file references instead of 'footer.php'.  Either create a 'footer-invalid.php' with W3C links disabled, or link to 'footer.php' in this script.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Maumelle Weather

  • Forecaster
  • *****
  • Posts: 1827
    • Maumelle Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #86 on: September 15, 2015, 05:54:21 PM »
Thanks Jerry and Ken!!!!!
GR2AE, GR3, Cumulus

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #87 on: September 15, 2015, 06:37:46 PM »
There was a <div> problem that affected centering, John.  Re-download and see if this slightly modified version helps.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #88 on: September 15, 2015, 06:46:25 PM »
Jerry, mine displays "Debug:" just above the map window. It's at 2 locations in the script. Suspect you meant to comment those out?

http://tiggrweather.net/wxusalerts.php

Thanks.
John
W7JKG

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #89 on: September 15, 2015, 07:28:44 PM »
Jerry, mine displays "Debug:" just above the map window. It's at 2 locations in the script. Suspect you meant to comment those out?

http://tiggrweather.net/wxusalerts.php

Thanks.
Good eye, John!  This was some leftover, ultimately useless debug code I forgot to delete.  Try the latest version's corrected code now.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #90 on: September 15, 2015, 08:47:56 PM »
All better!

Thanks.
John
W7JKG

Offline mikeym2m

  • Senior Contributor
  • ****
  • Posts: 153
    • MikeyM's Thornhurst PA Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #91 on: September 17, 2015, 04:12:40 PM »
As always - Thanks Jerry

Cheers

  =D&gt;

MikeyM

Offline KapitainOne

  • Senior Contributor
  • ****
  • Posts: 255
    • Sanford Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #92 on: September 29, 2015, 11:54:05 AM »
For some reason I'm not getting the Legend underneath the map displayed properly?

http://www.sanfordweather.com/wxusalerts.php

Any hints would be appreciated.

Thanks
Bill

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #93 on: September 29, 2015, 12:16:50 PM »
For some reason I'm not getting the Legend underneath the map displayed properly?

http://www.sanfordweather.com/wxusalerts.php

Any hints would be appreciated.

Thanks
Bill
I think it's your modifications, Bill.

Go here, click on the 'code' link, right-click, select 'Save as...', and save without the '.txt'.  I would suggest that you only modify the code if you really understand what you're doing.  Modifying the Legend as sent by the NWS and scraped by the script requires very advanced web programming skills.  I haven't tried it even though the NWS uses duplicate ID"s on the Legend for the color squares, to which W3C's validator objects.  Moving things around on the page will also create problems for the unwary.

Let us know if the Legend is still a problem after getting a fresh copy of the script.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline KapitainOne

  • Senior Contributor
  • ****
  • Posts: 255
    • Sanford Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #94 on: September 29, 2015, 12:25:16 PM »
Jerry

Downloaded the script again and no change!

The only modification I made to your script was to change the include footer-invalid.php to footer.php! I have not yet done that with the new download!

I know better than to try and mess with anything to do with info scraped by a script my php skills are on the weak side!

Bill

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #95 on: September 29, 2015, 12:43:00 PM »
Jerry

Downloaded the script again and no change!

The only modification I made to your script was to change the include footer-invalid.php to footer.php! I have not yet done that with the new download!

I know better than to try and mess with anything to do with info scraped by a script my php skills are on the weak side!

Bill
OK, my bad! :oops:  There's a dependent script, 'wxusalerts-all.css' that's still needed, and which I forgot about.  I've folded it into the 'wxusalerts.php' on my site which you can now download and save.  I'm not sure that everything in the CSS style is now needed, but I've not changed it for fear of breaking something.

Sorry about that, Bill!

Edit:  The entire CSS style is necessary for proper 'wxusalerts.php' display.  I commented out the ID's and colors, and the colors disappeared.
« Last Edit: September 29, 2015, 12:51:29 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline KapitainOne

  • Senior Contributor
  • ****
  • Posts: 255
    • Sanford Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #96 on: September 29, 2015, 12:48:37 PM »
 =D&gt; =D&gt;

That was the ticket, I had downloaded the css file and it was/is on my site but I didn't check if the file names were all correct!

Now working, thanks for the script!

Bill

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #97 on: September 29, 2015, 01:16:16 PM »
It looks like you need a footer of some sort.  I would suggest just continuing to use your normal footer.  Use this code to display it in the absence of a 'footer-invalid.php':
Code: [Select]
############################################################################
if (file_exists("footer-invalid.php")) {
include("footer-invalid.php");
} else {
include ("footer.php");
}
############################################################################
Alternatively you could modify your footer to remove the W3C links and rename it as 'footer-invalid.php'.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #98 on: December 08, 2017, 07:38:51 AM »
When I tried to find the 'Blizzard Warning' this morning by clicking on the Alaska Map, I got a '404 - Not Found' error which indicated that the NWS had changed the links.

This necessitated a revision of this script to incorporate the new links.  As usual, you can obtain the new source, version 20171208, by right-clicking on the source, selecting 'Save as...' and saving it as a '.php' rather than a '.txt' file.

I've no idea how long ago the AK links were modified by the NWS... :oops:
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: WXUSALERTS Clickable Alerts Map Script
« Reply #99 on: December 08, 2017, 12:42:38 PM »
Thanks, Jerry.
John
W7JKG

 

anything