Read the statement by Michael Teeuw here.
GIF update from URL with MMM-EyeCandy
-
@Mykle1 How did you seed the url with a timestamp? When I visit
https://icons.wxug.com/data/weather-maps/radar/united-states/united-states-current-radar-animation.gif?1521767776
, I get the image returned (not a404
). -
Like this, because I need the seed to change. Feel free to tell me what I’m doing wrong. Hehe :-)
var getTimeStamp = new Date().getTime(); img.src = "https://icons.wxug.com/data/weather-maps/radar/united-states/united-states-current-radar-animation.gif&seed=" + getTimeStamp; pic.appendChild(img); wrapper.appendChild(pic);
-
@Mykle1 Yep, just needs to be a
?
before the first parameter. Anything after gets appended with an&
, e.g.https://icons.wxug.com/data/weather-maps/radar/united-states/united-states-current-radar-animation.gif?seed=1521767776&otherseed=4846528&page=2
.Making your code the following:
... // img creation, etc var getTimeStamp = new Date().getTime(); img.src = "https://icons.wxug.com/data/weather-maps/radar/united-states/united-states-current-radar-animation.gif?seed=" + getTimeStamp; pic.appendChild(img); wrapper.appendChild(pic);
-
@ninjabreadman said in GIF update from URL with MMM-EyeCandy:
Making your code the following:
That did the trick. The .gif file is refreshing to reflect the new data when it changes.
Thanks for the lesson. I do appreciate the help.
Peace!
-
I will post the update on github shortly. Thanks to our friend, @ninjabreadman, the module now works as it should.
EDIT:
A
git pull
in the /MagicMirror/modules/MMM-EyeCandy folder will fix you up. Please take note of the changes to the config.js entry. Also, please take into account that the url you gave only updates itself about every 15 minutes. -
Made the changes and did some testing this AM with no results.
-Was able to pull update and verify changes in EyeCandy.js were reflected.
-Updated config.js to reflect the example as well.
-Tracked my radar url for time stamp over time for change and no results.See some commented code, do I need to uncomment as test?
-
@JRWJR said in GIF update from URL with MMM-EyeCandy:
Made the changes and did some testing this AM with no results.
WTH?
I’m testing it right now. I will report shortly
-
Umm, it’s working fine here. The radar from your url has updated twice in the last 42 minutes and the module reflects those changes.
The update interval for the module is now 2 minutes but you won’t see changes to your radar url for 15 minute periods. That’s the url, not the module. Is that what you are talking about?
-
@Mykle1 Once issue pm2 restart mm or reboot, it will download\load gif from url and play only that loop.
I am going to isolate and maybe move to a new MM2 load to test. Will report back.
-
@JRWJR said in GIF update from URL with MMM-EyeCandy:
Will report back.
Ok, but my test has been running for over 3 hours now and the module is working as expected. Have you changed anything in the module files?