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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login