Read the statement by Michael Teeuw here.
Module Refresh at Midnight
-
I am developing MMM-WordOfTheDay (author: jmwyds) and I was hoping someone could help me out with getting it to automatically refresh at midnight. I currently have it updating on a refresh interval every hour but that seems to be doing nothing and I don’t know why. Any help is appreciated, thank you!
-
@jmwyds in your getDom, you only work off the first data item/word
item[0]dataNotification != null){ var wordd = this.dataNotification.rss.channel.item[0].title; var summ = this.dataNotification.rss.channel.item[0].summary.toString(); var shortDef = this.dataNotification.rss.channel.item[0].shortdef.toString();
-
@sdetweil Correct, yes. Merriam Webster by default supplies a list of 5 or so Words of the Day. By grabbing the first element, I am grabbing the first word with it’s definition, sentence, part of speech, etc.
Do you see me doing something else there? -
@jmwyds well, u said it didn’t work, with the current timing.
-
@sdetweil Ah, I’m sorry about that Sam. The module does work! The only thing that doesn’t work is that it doesn’t refresh itself at midnight like I want it to. If I do a restart of the mirror it pulls the word and it’s properties correctly. So I was hoping that you or someone else might have some expertise on that update interval aspect
Thanks!
Jack -
@jmwyds so, use the moment() class to calculate the number of milliseconds until u want the next word, and use that as the timer interval, then sendSocketNotification to the node_helper like u do at start time, to get the next word.
-
@jmwyds or
millis in a day is24*60*60*1000