NWS Details Link not working

Post Reply
PCW
Observer
Observer
Posts: 41
Joined: Sat Mar 23, 2019 2:03 pm
Location: Covington, WA USA
Station model: Davis Pro2
Software: Meteobridge
Contact:

NWS Details Link not working

Post by PCW » Fri Feb 07, 2020 12:12 pm

Hi Everyone,
I have the NWS Custom Forecast block installed and get the "Now: multiple hazards in effect" (See attachment. )
The "Click here for Details" link does not work. What is supposed to happen?
Sure could use some help.
Thanks.
Paul
nws forcast details link.JPG
nws forcast details link.JPG (44.4 KiB) Viewed 3157 times
Image

User avatar
MonyMony
Forecaster
Forecaster
Posts: 180
Joined: Sun Aug 20, 2017 12:54 pm
Location: Elkton, Maryland, US
Station model: Davis Pro 2
Software: WeatherCat/Meteobridge
Contact:

Re: NWS Details Link not working

Post by MonyMony » Mon Mar 02, 2020 1:04 pm

Hi Paul,

Short answer is YES. The block is not smart enough to allow for the details link to actually work. That descriptions is actually coming from NWS. I'm sure that then "Click here for Details" line could be stripped out and I have thought about doing just that but never actually remember to do it when I have the issue on my site. I would think a simple REPLACE statement would do the trick. Your post has inspired me so next time I see this on my site I will try and figure out a way to strip that out.

If you want the show the links then the Alerts block (cannot remember the exact name at the moment) will allow for the the full details of the NWS product.

Jay
Image

PCW
Observer
Observer
Posts: 41
Joined: Sat Mar 23, 2019 2:03 pm
Location: Covington, WA USA
Station model: Davis Pro2
Software: Meteobridge
Contact:

Re: NWS Details Link not working

Post by PCW » Mon Mar 02, 2020 4:11 pm

Jay,
Thanks for looking into this. I have limited programming experience so will not attempt to fix it without a cut and paste option. Soooo, if, or when you figure it out, I'd really appreciate an update.

Another issue, I do have the "warningsUS" block installed and when there are warnings, the text is a one line generic description with no linking ability. Is there any way to get a more detailed text?
Thanks for your help.
Paul
Image

User avatar
MonyMony
Forecaster
Forecaster
Posts: 180
Joined: Sun Aug 20, 2017 12:54 pm
Location: Elkton, Maryland, US
Station model: Davis Pro 2
Software: WeatherCat/Meteobridge
Contact:

Re: NWS Details Link not working

Post by MonyMony » Tue Mar 03, 2020 2:29 pm

Hi Paul,

So I checked my code and had already done this. Anyway, I made the following change to line 182 of the nwsForecastBlock.php file:

Code: Select all

<?php echo str_replace("/"," / ",str_replace("Thunderstorms","T-Storms",str_replace("Click HERE for Details","",trim($forecastsSevenDay[1][$i]))))?>
If you look at this I also replace "Thunderstorms" with "T-Storms" as I found that the long words like thunderstorm would cause some display weirdness. I also pad some spaces around "/" so that things will break and roll to the next line when displayed.

I am attaching the nwsForecastBlock.php in case you are not comfortable making the change yourself. Just make sure you have v4.0 of the block installed.

Hope this help!

Jay
Attachments
nwsForecastBlock.php.zip
With text replacement (line 182)
(2.55 KiB) Downloaded 72 times
Image

User avatar
MonyMony
Forecaster
Forecaster
Posts: 180
Joined: Sun Aug 20, 2017 12:54 pm
Location: Elkton, Maryland, US
Station model: Davis Pro 2
Software: WeatherCat/Meteobridge
Contact:

Re: NWS Details Link not working

Post by MonyMony » Tue Mar 03, 2020 2:31 pm

I'll look into the Warnings block behavior soon when I have a moment.

Jay
Image

PCW
Observer
Observer
Posts: 41
Joined: Sat Mar 23, 2019 2:03 pm
Location: Covington, WA USA
Station model: Davis Pro2
Software: Meteobridge
Contact:

Re: NWS Details Link not working

Post by PCW » Tue Mar 03, 2020 3:13 pm

Many thanks Jay!
I'll C&P your code today.

I'd love to add my wxcam to my site (sending to WU now) but am running out of my 1 TB limit with comcast each month so I've limited the snapshot record on my Foscam 1990p to 6Am to 5pm. Also throttled the resolution to 720p. Seems with all the home automation, streaming 4K movies, uploading wx to 4 different online users etc I'm pretty well considered an "online junkie". Got any suggestions?
Talk to you soon.
Paul
Image

PCW
Observer
Observer
Posts: 41
Joined: Sat Mar 23, 2019 2:03 pm
Location: Covington, WA USA
Station model: Davis Pro2
Software: Meteobridge
Contact:

Re: NWS Details Link not working

Post by PCW » Tue Mar 03, 2020 11:51 pm

Jay,
Here is a snipit of the warningUS block expanded. Pretty generic warning. Not even sure were in WA. Any chance we can improve on it?
Thanks for looking at this.
Paul
Attachments
waringUS.JPG
waringUS.JPG (32.37 KiB) Viewed 3112 times
Image

Post Reply