Author Topic: Refresh radar image  (Read 939 times)

0 Members and 1 Guest are viewing this topic.

Offline ValentineWeather

  • Forecaster
  • *****
  • Posts: 6454
    • Valentine Nebraska's Real-Time Weather
Refresh radar image
« on: May 24, 2025, 11:06:29 AM »
Is there a way to just refresh the NWS radar.  It needs to refresh every 3 minutes, but to do that I'm having to refresh the full page, which restarts the streaming camera. Currently using this code but refreshes full page.
<meta http-equiv="refresh" content="180 " />


 


The code below is the NWS radar GIF, I would like to refresh every 3 minutes and not the full web page: Is it possible?

<td  width="100%" ><div align= "center"><a href="https://radar.weather.gov/ridge/standard/KLNX_loop.gif" target="_blank" data-lightbox="image-1" data-title="  "><img src="https://radar.weather.gov/ridge/standard/KLNX_loop.gif" width="360" height="270" style="margin: 0px; padding: 0px; border: none"></a></div></td>

Website: https://www.valentinenebraska.net

Thanks

« Last Edit: May 24, 2025, 04:13:15 PM by ValentineWeather »

Offline Cutty Sark Sailor

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3422
    • Frankfort Weather - TwinHollies WeatherCenter
Re: Refresh radar image
« Reply #1 on: May 24, 2025, 11:11:17 PM »
This'll refresh the image only at 3 seconds (3000msec)... you can figure your "link'n'lightbox'n'etc"...
Code: [Select]
<img
src="https://radar.weather.gov/ridge/standard/KLNX_loop.gif?&amp;t=" onload='setTimeout(function() {src = src.substring(0, (src.lastIndexOf("t=")+2))+(new Date()).getTime()}, 3000)' onerror='setTimeout(function() {src = src.substring(0, (src.lastIndexOf("t=")+2))+(new Date()).getTime()}, 3000)' alt='KLNX Loop 3 Sec Refresh'>
« Last Edit: May 24, 2025, 11:29:11 PM by Cutty Sark Sailor »

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1469
  • BismarckWeather.net
    • BismarckWeather.net
Re: Refresh radar image
« Reply #2 on: May 25, 2025, 11:01:26 AM »
Here's another old tidbit.  Set to 10 seconds, but you can change that.

https://www.wxforum.net/index.php?topic=43884.msg446793;boardseen#new
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline ValentineWeather

  • Forecaster
  • *****
  • Posts: 6454
    • Valentine Nebraska's Real-Time Weather
Re: Refresh radar image
« Reply #3 on: May 25, 2025, 03:46:18 PM »
Thank you so much Cutty that worked.  =D&gt;

I did figure out how to make it work with lightbox.

Thanks for the tip 92Merc.


Offline ValentineWeather

  • Forecaster
  • *****
  • Posts: 6454
    • Valentine Nebraska's Real-Time Weather
Re: Refresh radar image
« Reply #4 on: May 25, 2025, 05:23:14 PM »
In the event someone else needs the lightbox full code I used:


 <td  width="100%" ><div align= "center">   <a href="https://radar.weather.gov/ridge/standard/KLNX_loop.gif" target="_blank" data-lightbox="image-1" data-title="  "><img  src="https://radar.weather.gov/ridge/standard/KLNX_loop.gif?&amp;t=" onload='setTimeout(function() {src = src.substring(0, (src.lastIndexOf("t=")+2))+(new Date()).getTime()}, 3000)' onerror='setTimeout(function() {src = src.substring(0, (src.lastIndexOf("t=")+2))+(new Date()).getTime()}, 3000)' alt='KLNX Loop 3 Sec Refresh' width="350" height="270" style="margin: 0px; padding: 0px; border: none"></a></div></td>