MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    1. Home
    2. number1dan
    3. Best
    MagicMirror² v2.20.0 is available! For more information about this release, check out this topic.
    N
    • Profile
    • Following 0
    • Followers 0
    • Topics 5
    • Posts 10
    • Best 5
    • Controversial 0
    • Groups 0

    Best posts made by number1dan

    • Modules starting hidden.

      Hello there. I would like to know if there’s an easy way for a module to be ready but hidden. My particular case is having a module hidden until i give the voice command to show itself. All my voice commands work and I have achieved what i wanted in terms of it being hidden but it feels a bit convoluted and am wondering if there was an easier way. It will probably be best if I write what I’ve done.

      Module in question: MMM-Instagram
      Voice Module: MMM-voice

      As soon as the Instagram module received the ALL_MODULES_STARTED notification and has sent the REGISTER_VOICE_MODULE notification I’ve asked it to also send a socket notification INITIAL_HIDE. the node_helper.js then receives and literally sends INITIAL_HIDE straight back and then i have an “if socketnotification INITIAL_HIDE received then hide()”. In my inexperienced minds opinion, this makes the Instagram module ready and available to the voice module but hides before instagram pictures start showing up. Is there a more efficient way of doing this?

      I can clarify if I’ve not been clear. I’m quite new to this, the only experience with javascript I’ve had before is writing simple parsing scripts for a SIEM tool at my old work.

      Thanks,
      Dan

      posted in Troubleshooting
      N
      number1dan
    • Easy Twitter feed

      Hey Guys, I’m new and just started messing around with MM2 on Ubuntu Desktop before I get my Pi for Xmas. Just wanted to let you guys know something I’ve found whilst playing,unless someones mentioned it before. I couldnt see an easy module for twitter feeds so if anyone wants to stream your favourite twitter feeds then you can just use the default newsfeed module and use the url specified as https://twitrss.me/twitter_user_to_rss/?user=[USERNAME]. The site converts twitter feeds into RSS feed so it’s compatible. I stumbled upon trying to make a transport update module for my local train station and wasnt having any luck and whilst poking around their site I remembered they posted their news on twitter and voila.
      Enjoy,

      Dan

      posted in General Discussion
      N
      number1dan
    • RE: Request a Twitterfeed

      Hi,

      just stumbled across this. Don’t know if you still need any info on this but what i did was change the url in the newsfeed module to https://twitrss.me/twitter_user_to_rss/?user=[USER] where user is the twitter feed that i wanted. The site changes the feed into rss which the default newsfeed module can deal with. Hope that helps

      posted in Requests
      N
      number1dan
    • RE: MMM-newsfeedtouch - News so hot you wanna touch it

      @broberg Hi, great module it works well for me. however… After seeing this I though OH MAYBE I WANT A VIDEO TO PLAY WHEN I CLICK ON SOMETHING, so i tried to make a module for it and then it just wouldn’t work. So i sort of fiddled with this one to have 1 hardcoded “headline” which when clicked on, opened an iframe element and played the latest video from a youtube playlist as shown below.

      0_1496717074667_snip1.JPG
      0_1496717078788_snip2.JPG

      //codechange
                              var title = document.createElement("div");
                              title.className = "bright small regular fed";
      
      
                              title.innerHTML = "Zero Punctuation Review";
                              title.addEventListener("click", () => showdesc(this)); //Show description on click
                              wrapper.appendChild(title);
      
      
                              //below is the function to show description and hide title
                              function showdesc(thisdesc) {
                                      thisdesc.intpause();    //clear interval
                                      title.style.display="none";
      /*                              var readTimer = setTimeout(function() {hidedesc(thisdesc)}, thisdesc.config.readInterval); //sets timeout for the description
                                      description = document.createElement("div");
                                      description.className = "infoCenter";
                                      description.innerHTML = thisdesc.newsItems[thisdesc.activeItem].description;
                                      description.addEventListener("click", () => hidedesc(thisdesc));  //Hide description on click
                                      description.addEventListener("click", () => clearTimeout(readTimer)); //Stop timer when clicked so the next title doesn't reload again.
      */
      
                                      description = document.createElement ("iframe");
                                      description.className = "vid";
                                      description.src = 'https://www.youtube.com/embed/htm+lastest?list=PLAbMhAYRuCUhawCEV2oXZGrienoKTN16X&autoplay=1';
                                      description.autoplay = true;
                                      description.addEventListener("click", () => hidedesc(thisdesc));  //Hide description on click
                                      description.addEventListener("click", () => clearTimeout(readTimer)); //Stop timer when clicked so the next title doesn't reload again.
      
      //                              wr.appendChild(video);
      
      
      
      
      
      
      
                                      wrapper.appendChild(description);
      
      
                              };
      
                              //and to close the description on click and get next title
                              function hidedesc(thisdesc) {
                                      thisdesc.activeItem++;
                                      thisdesc.intresume();   //resume the interval
                                      description.style.display="none";
                              };
      
      //codechange end
      

      Just a Suggestion in case you wanted in the future to incorporate playing the news release video as an option for your module. Sorry for playing with it!

      posted in Utilities
      N
      number1dan
    • RE: MMM-MovieInfo

      nice module. I have this starting hidden and then voice command it to show. I’ve also changed the start and end dates for it to show stuff in cinema now and removed the greyscale from the poster. Good job making this module

      posted in Entertainment
      N
      number1dan
    • 1 / 1