MagicMirror² v2.7.0 is available! For more information about this release, check out this topic.

Newsfeed not displaying on MM



  • The default newsfeed module is not displaying when I run MM, and doesn’t say it is loading. It used to work fine. I’ve since made made various edits and added an additional news source and it’s still not working. This is what it looks like in the config.js file:

                    {
                            module: "newsfeed",
                            position: "bottom_bar",
                            config: {
                                    feeds: [
                                            {
                                                    title: "ABC News",
                                                    url: "http://abc.net.au/news/feed/51120/rss.xml",
                                            },
                                            {
                                                    title: "Huffington Post",
                                                    url: "https://www.feedspot.com/infiniterss.php?q=site:http%3A%2F%2Fwww.huffingtonpost.com.au%2Frss%2Findex.xml",  
                                            },
                                    ],
                                    showSourceTitle: true,
                                    showPublishDate: true,
                            }
                    },
            ]
    
    };
    

    and this is what the default newsfeed module looks like:

    Module.register("newsfeed",{
    
            // Default module config.
            defaults: {
                    feeds:
                            {
                                    title: "ABC News",
                                    url: "http://abc.net.au/news/feed/51120/rss.xml",
                                    encoding: "UTF-8"
                            },
                            {
                                    title: "Huffington Post",
                                    url: "https://www.feedspot.com/infiniterss.php?q=site:http%3A%2F%2Fwww.huffingtonpost.com.au%2Frss%2Findex.xml",
                             },
    
                    ],
                    showSourceTitle: true,
                    showPublishDate: true,
                    showDescription: false,
    

  • Project Sponsor

    You either did not copy the entire URL for the 2nd feed when posting it to the forum, or you didn’t copy the entire URL when posting to your config.js file. The HuffPo URL in your config is missing the XML extension and closing quotation marks.



  • @bhepler The end of the URL is there, you just have to scroll across due to its length. I wish that was the problem haha


  • Project Sponsor

    @redkittens The end of the URL is there from the default config.js but it’s not in the 1st one. Scrolling right isn’t making it appear for me.

    The other thing I noticed was that you apparently started copying from your config a couple lines early, but I presume those close brackets are continuations from other module configs.

    The default feeds from the module are there in case you don’t have your own RSS feeds, right? So you can test out the module by deleting the feeds from your configuration. So try it out. Change your config.js entry for the newsfeed module to only read as so:

    {
         module: "newsfeed",
         position: "bottom_bar",
    },
    

    You should get two news feeds in the module. If it works, add the config & feed parameters and make sure it still works.



  • @bhepler Oh my bad, that was a bad copy and paste and I’ve edited it for clarity. I just changed my config.js entry to what you recommended and unfortunately still no display. There must be an error in my newsfeed.js file. Thanks for your suggestion though


  • Project Sponsor

    @redkittens - In general, you should not be modifying the module javascript files. newsfeed.js, clock.js, etc work pretty well and you just need to modify your config.js to configure the modules correctly.

    For example, you’re trying to modify the newsfeeds that are used by the newsfeed module, yes? Any configuration that you put in the config.js will override the defaults in the newsfeed.js module. You don’t need to overwrite the default values because the Magic Mirror framework will do it for you.

    If you need to add functionality to a module, then it’s a different story. But in my experience about 85% of what users need can be handled with careful editing of the config.js file.