MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-NewsAPI

    Scheduled Pinned Locked Moved Utilities
    103 Posts 10 Posters 78.9k Views 8 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mumblebajM Offline
      mumblebaj Module Developer @swvalenti
      last edited by

      @swvalenti You can clone the module from here:
      MMM-News
      The config should still work.

      Check out my modules at: https://github.com/mumblebaj?tab=repositories
      Check my blog-post: https://mumblebaj.xyz/
      Check my MM Container: https://hub.docker.com/repository/docker/mumblebaj/magicmirror/general

      swvalentiS 1 Reply Last reply Reply Quote 0
      • swvalentiS Offline
        swvalenti Project Sponsor @mumblebaj
        last edited by

        @mumblebaj gave yours a try but get this error?

        MMM-NewsAPI.js:129 Uncaught TypeError: Cannot read property 'sourceId' of undefined
            at Class.draw (MMM-NewsAPI.js:129)
            at Class.socketNotificationReceived (MMM-NewsAPI.js:96)
            at module.js:245
            at Socket.<anonymous> (socketclient.js:38)
            at Socket../node_modules/component-emitter/index.js.Emitter.emit (index.js:145)
            at Socket.emit (typed-events.js:46)
            at Socket.emitEvent (socket.js:263)
            at Socket.onevent (socket.js:250)
            at Socket.MMSocket.socket.onevent (socketclient.js:32)
            at Socket.onpacket (socket.js:214)
        

        Config

                        module: "MMM-NewsAPI",
                        header: "news",
                        position: "bottom_bar",
                        config: {
                                apiKey: "super duper secret",
                                type: "horizontal",
                                choice: "headlines",
                                pageSize: 9,
                                className: "NEWS",
                                drawInterval: 1000*30,
                                templateFile: "template.html",
                                fetchInterval: 1000*60*60,
                                query: {
                                        country: "us",
                                        //category: "",
                                        //q: "covid",
                                        //qInTitle: "",
                                        sources: "Fox News",
                                        domains: "foxnews.com",
                                        //excludeDomains: "",
                                        language: "en"
                                },
                        }
        },
        
        mumblebajM 1 Reply Last reply Reply Quote 0
        • mumblebajM Offline
          mumblebaj Module Developer @swvalenti
          last edited by mumblebaj

          @swvalenti said in MMM-NewsAPI:
          The issue is with sources “Fox News”. That is not a valid source. Remove it and it should work fine with just the domain of foxnews.com

          Check out my modules at: https://github.com/mumblebaj?tab=repositories
          Check my blog-post: https://mumblebaj.xyz/
          Check my MM Container: https://hub.docker.com/repository/docker/mumblebaj/magicmirror/general

          swvalentiS 1 Reply Last reply Reply Quote 0
          • swvalentiS Offline
            swvalenti Project Sponsor @mumblebaj
            last edited by

            @mumblebaj said in MMM-NewsAPI:

            @swvalenti said in MMM-NewsAPI:
            The issue is with sources “Fox News”. That is not a valid source. Remove it and it should work fine with just the domain of foxnews.com

            Understood, works great now. Nice module good job!!!

            bugsounetB 1 Reply Last reply Reply Quote 0
            • bugsounetB Offline
              bugsounet Banned @swvalenti
              last edited by

              @mumblebaj, perfect, that i see Transfert is now done ;)

              Happy coding,
              @bugsounet

              mumblebajM 1 Reply Last reply Reply Quote 0
              • mumblebajM Offline
                mumblebaj Module Developer @bugsounet
                last edited by

                @bugsounet Thank you. I have received.

                Check out my modules at: https://github.com/mumblebaj?tab=repositories
                Check my blog-post: https://mumblebaj.xyz/
                Check my MM Container: https://hub.docker.com/repository/docker/mumblebaj/magicmirror/general

                swvalentiS 1 Reply Last reply Reply Quote 0
                • swvalentiS Offline
                  swvalenti Project Sponsor @mumblebaj
                  last edited by

                  @mumblebaj Module stopped working you working on it?

                  swvalentiS 1 Reply Last reply Reply Quote 0
                  • swvalentiS Offline
                    swvalenti Project Sponsor @swvalenti
                    last edited by

                    No errors just doesn’t show in region

                    mumblebajM S 2 Replies Last reply Reply Quote 0
                    • mumblebajM Offline
                      mumblebaj Module Developer @swvalenti
                      last edited by

                      @swvalenti I will have a look shortly. It is running just fine on my mirror. Will start another instance and see

                      Check out my modules at: https://github.com/mumblebaj?tab=repositories
                      Check my blog-post: https://mumblebaj.xyz/
                      Check my MM Container: https://hub.docker.com/repository/docker/mumblebaj/magicmirror/general

                      1 Reply Last reply Reply Quote 0
                      • swvalentiS Offline
                        swvalenti Project Sponsor
                        last edited by

                        sorry I meant to say MMM-News but also NewsAPI just shows gray line and News heading and nothing else

                        mumblebajM 1 Reply Last reply Reply Quote 0
                        • mumblebajM Offline
                          mumblebaj Module Developer @swvalenti
                          last edited by

                          @swvalenti MMM-News can be cloned from the following repo:

                          MMM-News

                          I have made a change to MMM-NewsAPI which resolves CSS conflicts and it should now work when running MMM-News at the same time.

                          Check out my modules at: https://github.com/mumblebaj?tab=repositories
                          Check my blog-post: https://mumblebaj.xyz/
                          Check my MM Container: https://hub.docker.com/repository/docker/mumblebaj/magicmirror/general

                          swvalentiS 1 Reply Last reply Reply Quote 0
                          • swvalentiS Offline
                            swvalenti Project Sponsor @mumblebaj
                            last edited by

                            @mumblebaj sent you a pm chat

                            1 Reply Last reply Reply Quote 0
                            • S Do not disturb
                              sdetweil @swvalenti
                              last edited by sdetweil

                              @swvalenti if u look in the developers window, console tab, are there any errors?

                              is the module listed in the sources list, and is the content in the elements tab, but maybe marked display:none?

                              Sam

                              How to add modules

                              learning how to use browser developers window for css changes

                              swvalentiS 1 Reply Last reply Reply Quote 0
                              • swvalentiS Offline
                                swvalenti Project Sponsor @sdetweil
                                last edited by

                                @sdetweil I got it all squared away thanks Sam!

                                1 Reply Last reply Reply Quote 0
                                • M Offline
                                  mwm341
                                  last edited by

                                  Will MMM-NewsAPI allow displaying full articles in an iFrame?

                                  M 1 Reply Last reply Reply Quote 0
                                  • M Offline
                                    mwm341 @mwm341
                                    last edited by

                                    @mwm341 said in MMM-NewsAPI:

                                    Will MMM-NewsAPI allow displaying full articles in an iFrame?

                                    Maybe an answer:
                                    Gonna try splicing template.html into a responsive iFrame.

                                    Wish me luck!

                                    mumblebajM 1 Reply Last reply Reply Quote 0
                                    • mumblebajM Offline
                                      mumblebaj Module Developer @mwm341
                                      last edited by

                                      @mwm341 It is not setup for that at the moment but, you are more than welcome to make a PR. :winking_face:

                                      Check out my modules at: https://github.com/mumblebaj?tab=repositories
                                      Check my blog-post: https://mumblebaj.xyz/
                                      Check my MM Container: https://hub.docker.com/repository/docker/mumblebaj/magicmirror/general

                                      mumblebajM 1 Reply Last reply Reply Quote 0
                                      • mumblebajM Offline
                                        mumblebaj Module Developer @mumblebaj
                                        last edited by

                                        The following updates have been made to the module. Please feel free to do a git pull and then an npm install in the module directory.

                                        • Removed the request module and replaced with node-fetch due to request being deprecated.

                                        • Update to the config.js. You have to remove the following line from you config.js.

                                        className: "News"
                                        
                                        • The CSS has been changed to avoid conflicts with other modules. Hence the above className is no longer required and must be removed from the config.js.

                                        Check out my modules at: https://github.com/mumblebaj?tab=repositories
                                        Check my blog-post: https://mumblebaj.xyz/
                                        Check my MM Container: https://hub.docker.com/repository/docker/mumblebaj/magicmirror/general

                                        1 Reply Last reply Reply Quote 0
                                        • MZ-BERM Offline
                                          MZ-BER
                                          last edited by

                                          Hey there - thanks for offering this module (NewsAPI). It works so far really well.

                                          But I noticed that the module doesn’t refresh the news as I am forcing it based on my config.

                                          The fetchInterval: is set to 1800*1000 // 30 minutes, but I still receive news that are 5 days old.
                                          Only if I restart the MM (npm start) it is pulling the recent news.

                                          And as you can see in the screenshot below, the NewsAPI doesn’t receive requests, as I’m actually expecting all 30min.

                                          e70296fc-666d-4d17-8253-59c6a8dee5ce-image.png

                                          mumblebajM 1 Reply Last reply Reply Quote 0
                                          • mumblebajM Offline
                                            mumblebaj Module Developer @MZ-BER
                                            last edited by

                                            @mz-ber Hi. I just had a look and mine is running fine and has the latest articles. Can you set debug: true in the config to see if it pulls new articles or if an error is returned? I have not run my mirror the past few days due to power issues hence my stats are low but I have been running it all day today and will check back on the stats. Let me know if you see anything in debug mode please.
                                            edc91b4c-0c28-40d9-8a93-0234e2e5df93-image.png

                                            Check out my modules at: https://github.com/mumblebaj?tab=repositories
                                            Check my blog-post: https://mumblebaj.xyz/
                                            Check my MM Container: https://hub.docker.com/repository/docker/mumblebaj/magicmirror/general

                                            MZ-BERM 1 Reply Last reply Reply Quote 0

                                            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
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 2 / 6
                                            • First post
                                              Last post
                                            Enjoying MagicMirror? Please consider a donation!
                                            MagicMirror created by Michael Teeuw.
                                            Forum managed by Sam, technical setup by Karsten.
                                            This forum is using NodeBB as its core | Contributors
                                            Contact | Privacy Policy