Refresh options in the HTML Widget

  • 1
  • Question
  • Updated 2 years ago
  • Answered
  • (Edited)
Good Afternoon: 

We display our presentation using the RiseVision player.  I have one HTML widget displaying the current weather conditions and I would like the widget to auto-refresh once an hour, unfortunately, I'm not having any luck. It seems I can only set the player to reboot once a day.  Is there a way to change the settings?

Or 

Is there a way I could change the iframe coding to auto-refresh?  Sorry, I am not a developer. 

Here's the iframe coding: 

http://forecast.io/embed/#lat=42.3583...; Ma">

Thanks, 

Steven
Photo of Steven Cabral

Steven Cabral

  • 170 Points 100 badge 2x thumb

Posted 3 years ago

  • 1
Photo of HSuarez

HSuarez

  • 11,896 Points 10k badge 2x thumb
Hi Steven,

Can you try the following? This was from another code example that we have:


<iframe id="forecast" src="http://forecast.io/embed/#lat=42.3583&lon=-71.0603&name=Cambridge Ma" frameborder="0"></iframe>

<script type="text/javascript">
setInterval(refreshIframe, 5000);
function refreshIframe() {
var frame = document.getElementById("forecast");
frame.src = frame.src;
}
</script>


(June 1 note: code updated with another example)

Another suggestion is to allocate a duplicate copy of that HTML widget in the same Placeholder and set a duration of something like 100 seconds for each widget. That way, when it is time to go into the HTML widget copy it should prompt a refresh. We suggested something similar for another embedded iframe dashboard for oil prices.

Another item to keep in mind is that forecast.io may have their rate as to how often the data is refreshed..
(Edited)
Photo of HSuarez

HSuarez

  • 11,896 Points 10k badge 2x thumb
Also depends on what the refresh rate is for the original source. For example if they update their data every hour, you may need to set the refresh rate every hour instead..
Photo of Kyle

Kyle

  • 708 Points 500 badge 2x thumb
Thank you again for the help! I actually found out that with forecast.io, you can embed or just simply use a URL. Naturally I went with the URL route (Web Page widget) and set it to refresh every 5 minutes. Here's an example:

http://forecast.io/embed/#lat=37.7771&lon=-122.4196&name=San%20Francisco
Photo of HSuarez

HSuarez

  • 11,896 Points 10k badge 2x thumb
thanks! yes the web page widget would be the preferred route.
Photo of Darius - PRODO.us

Darius - PRODO.us, Champion

  • 26,850 Points 20k badge 2x thumb
That is what I did too. Only I am updating it hourly.
Photo of Steve Gregory

Steve Gregory, Champion

  • 1,186 Points 1k badge 2x thumb
I agree that using the Web Page widget is the better way.

Also, in the script:
  setInterval(refreshIframe, 5000);
... the interval time (5000) is in milliseconds, so 5000 mS (5 seconds) is probably shorter than you want.  Use 300000 for 5 minutes.
Photo of Darius - PRODO.us

Darius - PRODO.us, Champion

  • 26,850 Points 20k badge 2x thumb
Steven, I am using meta refresh <meta http-equiv="refresh" content="5">, as in here: https://en.wikipedia.org/wiki/Meta_refresh
(Edited)
Photo of Steven Cabral

Steven Cabral

  • 170 Points 100 badge 2x thumb
Thank you both!!