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.
    • 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
                    • S Offline
                      sdetweil @sdetweil
                      last edited by

                      @swvalenti you could also open an issue on the module github page and hope the author might look at it… has updates from about 9 months ago…

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

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

                        @sdetweil It is a screen scraper. I see he says he commented some line and it is working again for him.

                        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

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

                          @mumblebaj cool. but doesn’t change the work

                          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 tried pulling an issue ticket on github to no avail. @mumblebaj what is a screen scraper and can you assist in fixing?

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

                              @swvalenti remember this is volunteer work… we have other things in our lives…

                              many developers do this in the winter when they are stuck in the house. and when they can go outside, they do…

                              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 said in MMM-PGA:

                                @swvalenti remember this is volunteer work… we have other things in our lives…

                                many developers do this in the winter when they are stuck in the house. and when they can go outside, they do…

                                completely understand sir

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

                                  @swvalenti The issue is in the ESPN.js at line 49 or so. It is looking for defendingChampion.athlete but there isn’t one and it fails. I see you have created an issue on GitHub but sometimes the guys abandon their modules. Maybe the developer responds to you issue. You could change line 49 to the below and it should work.

                                  I would have done it this way:

                                  tournament.defendingChamp = event.defendingChampion ? event.defendingChampion.athlete.displayName : ""
                                  

                                  94340480-6e5a-488b-be15-6a18dc792f4d-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

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

                                    @mumblebaj said in MMM-PGA:

                                    tournament.defendingChamp = event.defendingChampion ? event.defendingChampion.athlete.displayName : “”

                                    @mumblebaj you are the man that worked thank you! I am going to do a PR and change

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

                                      I forked and made changes so module is now working again. @mumblebaj thanks for the help.

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

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

                                        @swvalenti Awesome. Glad it is working.

                                        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 is stuck on loading but no errors in dev console?

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

                                            @swvalenti Are you using the original module? Is this happening after upgrade to MM2.19? Did you do the normal git pull && npm install in the module folder? Is there any errors in the pm2 logs if you are using pm2 or in the console if you are using npm start?

                                            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

                                            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
                                            • 2 / 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