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-PGA

    Scheduled Pinned Locked Moved Sport
    48 Posts 7 Posters 48.1k Views 7 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.
    • mattcl8onM Offline
      mattcl8on Module Developer Project Sponsor
      last edited by

      Description:

      A module to show the Upcoming PGA tournament and leaderboard information once the tournament is in progress. The data is retrieved from ESPN. The module also allows you to pick favorite players and and show their status as well.

      I started building a magic mirror and found that there was not any modules to display golf scores. So i delayed my mirror build and wrote the module. This is the initial release so I’m interested in any feedback.

      Download:

      https://github.com/mcl8on/MMM-PGA

      Screenshots

      Upcoming Tournament View

      image

      Leaderboard View
      image

      Favorite View

      image

      Mykle1M 1 Reply Last reply Reply Quote 2
      • R Offline
        robertybob
        last edited by

        I’m not a fan of golf myself , but I’m sure this will be helpful for someone who is! Nice looking module too 😃

        1 Reply Last reply Reply Quote 0
        • Mykle1M Offline
          Mykle1 Project Sponsor Module Developer @mattcl8on
          last edited by

          @mattcl8on

          Very nice. Makes me think of my father. who, would have loved this module. :thumbsup:

          Create a working config
          How to add modules

          mattcl8onM 1 Reply Last reply Reply Quote 0
          • mattcl8onM Offline
            mattcl8on Module Developer Project Sponsor @Mykle1
            last edited by

            @Mykle1 Big shout out to you. I used your MMM-UFO to get started

            Mykle1M 1 Reply Last reply Reply Quote 1
            • Mykle1M Offline
              Mykle1 Project Sponsor Module Developer @mattcl8on
              last edited by

              @mattcl8on

              :thumbsup:

              Create a working config
              How to add modules

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

                Great job, just added it to my mirror!

                1 Reply Last reply Reply Quote 0
                • mattcl8onM Offline
                  mattcl8on Module Developer Project Sponsor
                  last edited by

                  Added a quick fix to github. The ESPN API was showing a cancelled tournament. If you reinstall it will show upcoming tournaments. Once Bermuda Championship starts it will show leader boards for that tournament

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

                    Getting this error now…can anyone help? Tried update uninstall/reinstall etc

                    1|MagicMirror  | [2020-12-05 17:02:23.100] [ERROR]  App threw an error during load
                    1|MagicMirror  | [2020-12-05 17:02:23.102] [ERROR]  Error: Cannot find module 'jsdom'
                    1|MagicMirror  | Require stack:
                    1|MagicMirror  | - /home/pi/MagicMirror/modules/MMM-PGA/OWGR.js
                    1|MagicMirror  | - /home/pi/MagicMirror/modules/MMM-PGA/node_helper.js
                    1|MagicMirror  | - /home/pi/MagicMirror/js/app.js
                    1|MagicMirror  | - /home/pi/MagicMirror/js/electron.js
                    1|MagicMirror  | - /home/pi/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js
                    1|MagicMirror  | -
                    1|MagicMirror  |     at Module._resolveFilename (internal/modules/cjs/loader.js:627:15)
                    1|MagicMirror  |     at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:41:16)
                    1|MagicMirror  |     at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/module-alias/index.js:49:29)
                    1|MagicMirror  |     at Function.Module._load (internal/modules/cjs/loader.js:531:27)
                    1|MagicMirror  |     at Module.require (internal/modules/cjs/loader.js:685:19)
                    1|MagicMirror  |     at require (internal/modules/cjs/helpers.js:16:16)
                    1|MagicMirror  |     at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-PGA/OWGR.js:3:15)
                    1|MagicMirror  |     at Module._compile (internal/modules/cjs/loader.js:786:30)
                    1|MagicMirror  |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:798:10)
                    1|MagicMirror  |     at Module.load (internal/modules/cjs/loader.js:645:32)
                    1|MagicMirror  | [2020-12-05 17:02:23.105] [ERROR]  Whoops! There was an uncaught exception...
                    1|MagicMirror  | [2020-12-05 17:02:23.106] [ERROR]
                    1|MagicMirror  | Error: Cannot find module 'jsdom'
                    1|MagicMirror  | Require stack:
                    1|MagicMirror  | - /home/pi/MagicMirror/modules/MMM-PGA/OWGR.js
                    1|MagicMirror  | - /home/pi/MagicMirror/modules/MMM-PGA/node_helper.js
                    1|MagicMirror  | - /home/pi/MagicMirror/js/app.js
                    1|MagicMirror  | - /home/pi/MagicMirror/js/electron.js
                    1|MagicMirror  | - /home/pi/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js
                    1|MagicMirror  | -
                    1|MagicMirror  |     at Module._resolveFilename (internal/modules/cjs/loader.js:627:15)
                    1|MagicMirror  |     at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:41:16)
                    1|MagicMirror  |     at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/module-alias/index.js:49:29)
                    1|MagicMirror  |     at Function.Module._load (internal/modules/cjs/loader.js:531:27)
                    1|MagicMirror  |     at Module.require (internal/modules/cjs/loader.js:685:19)
                    1|MagicMirror  |     at require (internal/modules/cjs/helpers.js:16:16)
                    1|MagicMirror  |     at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-PGA/OWGR.js:3:15)
                    1|MagicMirror  |     at Module._compile (internal/modules/cjs/loader.js:786:30)
                    1|MagicMirror  |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:798:10)
                    1|MagicMirror  |     at Module.load (internal/modules/cjs/loader.js:645:32) {
                    1|MagicMirror  |   code: 'MODULE_NOT_FOUND',
                    1|MagicMirror  |   requireStack: [
                    1|MagicMirror  |     '/home/pi/MagicMirror/modules/MMM-PGA/OWGR.js',
                    1|MagicMirror  |     '/home/pi/MagicMirror/modules/MMM-PGA/node_helper.js',
                    1|MagicMirror  |     '/home/pi/MagicMirror/js/app.js',
                    1|MagicMirror  |     '/home/pi/MagicMirror/js/electron.js',
                    1|MagicMirror  |     '/home/pi/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js',
                    1|MagicMirror  |     undefined
                    1|MagicMirror  |   ]
                    1|MagicMirror  | }
                    1|MagicMirror  | [2020-12-05 17:02:23.119] [ERROR]  MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
                    1|MagicMirror  | [2020-12-05 17:02:23.120] [ERROR]  If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
                    
                    
                    S 1 Reply Last reply Reply Quote 0
                    • S Offline
                      sdetweil @swvalenti
                      last edited by

                      @swvalenti go to the module folder
                      npm install jsdom

                      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 Yea sorry thought I deleted that I figured it out after the fact. Thanks!

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

                          Anyone know how to fix this the error has to do with “athlete”??? Module is stuck on loading…

                          0|MagicMirror | MMM-PGA Retrieving Tounament List
                          0|MagicMirror | [12.06.2021 09:48.30.361] [LOG]
                          0|MagicMirror | MMM-PGA retrieving Tournament Data
                          0|MagicMirror | [12.06.2021 09:48.30.386] [ERROR]
                          0|MagicMirror | Whoops! There was an uncaught exception…
                          0|MagicMirror | [12.06.2021 09:48.30.388] [ERROR] TypeError: Cannot read property ‘athlete’ of undefined
                          0|MagicMirror | at Request._callback (/home/pi/MagicMirror/modules/MMM-PGA/ESPN.js:49:65)
                          0|MagicMirror | at Request.self.callback (/home/pi/MagicMirror/node_modules/request/request.js:185:22)
                          0|MagicMirror | at Request.emit (events.js:315:20)
                          0|MagicMirror | at Request. (/home/pi/MagicMirror/node_modules/request/request.js:1154:10)
                          0|MagicMirror | at Request.emit (events.js:315:20)
                          0|MagicMirror | at IncomingMessage. (/home/pi/MagicMirror/node_modules/request/request.js:1076:12)
                          0|MagicMirror | at Object.onceWrapper (events.js:421:28)
                          0|MagicMirror | at IncomingMessage.emit (events.js:327:22)
                          0|MagicMirror | at endReadableNT (_stream_readable.js:1220:12)
                          0|MagicMirror | at processTicksAndRejections (internal/process/task_queues.js:84:21)

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

                            Anyone able to help as it seems the developer has abandoned the project…something to do with “athlete” in the json requests etc but idk where to start to fix that but willing to give it a shot with some direction. Thanks!

                            S 1 Reply Last reply Reply Quote 0
                            • S Offline
                              sdetweil @swvalenti
                              last edited by

                              @swvalenti I don’t know, but you could

                              console.log(JSON.stringify(data,null,2))
                              

                              (replace ‘data’ with the variable name of the response from the request)

                              to dump out the data u got back and examine the structure to see if it changed
                              if u have the exact URL, you usually can do this in a browser too…

                              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 swvalenti

                                @sdetweil Not sure I follow Sam I am new to json

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

                                  @cowboysdude @Mykle1 Calling on the big guns here if you have any ideas :face_with_tongue:

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

                                    Can anyone explain or help me to try and get this module working again? Seems simple enough as ‘athlete’ is throwing the error but idk where to start.

                                    S 1 Reply Last reply Reply Quote 0
                                    • S Offline
                                      sdetweil @swvalenti
                                      last edited by

                                      @swvalenti as I said, u can use some tools in the coding to get the json data structure printed out so you can examine it

                                      or, use the url in a browser to collect the info.

                                      once u have that you can attempt to find the info the module needed
                                      and maybe change the code to match

                                      I use this site for validating json documents
                                      https://codebeautify.org/jsonvalidator?/jsonvalidate

                                      but it also allows you to format the data in a more readable fashion

                                      the code is trying to extract the player from the data returned
                                      Cannot read property ‘athlete’ of undefined
                                      0|MagicMirror | at Request._callback (/home/pi/MagicMirror/modules/MMM-PGA/ESPN.js:49:65)

                                      the code is the ESPN.js line 45, column 65

                                      u also may get noting back from the api at all…

                                      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 Ok but which url do I use to check the json?

                                        swvalentiS S 2 Replies Last reply Reply Quote 0
                                        • swvalentiS Offline
                                          swvalenti Project Sponsor @swvalenti
                                          last edited by

                                          I just commented that line out and now it works! HA

                                          1 Reply Last reply Reply Quote 0
                                          • S Offline
                                            sdetweil @swvalenti
                                            last edited by

                                            @swvalenti the url used by the code to get the data from the api…

                                            I don’t know the module at all, just trying to give some help.

                                            Someone (You) will have to become the programmer.
                                            learn how the module works in enough detail to :

                                              1. find where the error occurs (this is given to you)
                                              1. develop some mechanism to capture the data that results in the failure
                                              1. analyze the data to determine the cause
                                              1. develop a strategy for fixing the ‘problem’
                                              1. apply the strategy to the existing code

                                              repeat 1-5 til you have resolved the problem(s) successfully, or abandon the task

                                            Sam

                                            How to add modules

                                            learning how to use browser developers window for css changes

                                            S mumblebajM 2 Replies 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
                                            • 1 / 3
                                            • 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