• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

Need help for rewrite node_helper.js from 'request' to 'got'

Scheduled Pinned Locked Moved Development
19 Posts 2 Posters 1.4k Views 2 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 @htilburgs
    last edited by sdetweil Jun 24, 2024, 8:58 PM Jun 24, 2024, 8:57 PM

    @htilburgs depends on what you mean by correct.

    it returns the parsed text as an object
    not text.

    Sam

    How to add modules

    learning how to use browser developers window for css changes

    H S 2 Replies Last reply Jun 24, 2024, 9:24 PM Reply Quote 0
    • H Offline
      htilburgs @sdetweil
      last edited by Jun 24, 2024, 9:24 PM

      @sdetweil
      That I don’t understand.
      Is this a problem? What would be better?

      (still trying to learn JS, but not afraid to ask) ☺

      S 1 Reply Last reply Jun 24, 2024, 10:07 PM Reply Quote 0
      • S Offline
        sdetweil @htilburgs
        last edited by Jun 24, 2024, 10:07 PM

        @htilburgs the response.json() function returns a js object already parsed.

        thst is what yiy were going to fo w JSON.parse(). but don’t need to.

        I don’t know if the CONTENT of the object is correct, but it should be for the same request

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        H 1 Reply Last reply Jun 24, 2024, 10:14 PM Reply Quote 0
        • H Offline
          htilburgs @sdetweil
          last edited by Jun 24, 2024, 10:14 PM

          @sdetweil
          In the previous version with ‘request’ I used JSON.parse() and got the same results.
          The module works, but I didn’t know for sure if I used the correct approach.

          (still trying to learn JS, but not afraid to ask) ☺

          S 1 Reply Last reply Jun 24, 2024, 10:16 PM Reply Quote 0
          • S Offline
            sdetweil @htilburgs
            last edited by sdetweil Jun 24, 2024, 10:17 PM Jun 24, 2024, 10:16 PM

            @htilburgs if you push the repo I’ll look at it… you can do it on a separate branch to not disturb the existing

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            H 1 Reply Last reply Jun 25, 2024, 3:50 AM Reply Quote 0
            • H Offline
              htilburgs @sdetweil
              last edited by Jun 25, 2024, 3:50 AM

              @sdetweil published it. Didn’t know how than on Master.

              (still trying to learn JS, but not afraid to ask) ☺

              S 1 Reply Last reply Jun 25, 2024, 4:03 AM Reply Quote 0
              • S Offline
                sdetweil @htilburgs
                last edited by Jun 25, 2024, 4:03 AM

                @htilburgs ok, I’ll look at it first thing in the morning

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • S Offline
                  sdetweil @sdetweil
                  last edited by Jun 25, 2024, 3:13 PM

                  @htilburgs I made a couple changes to the Js and added comments to the node_helper, but all looks ok …

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  H 1 Reply Last reply Jun 25, 2024, 7:52 PM Reply Quote 0
                  • H Offline
                    htilburgs @sdetweil
                    last edited by Jun 25, 2024, 7:52 PM

                    @sdetweil
                    Hi Sam, thanks in advance. I’m not at home right now and I only have my smartphone. I cannot test, but I’ll try it in a day.

                    I’ll let you know!!

                    (still trying to learn JS, but not afraid to ask) ☺

                    S 1 Reply Last reply Jun 25, 2024, 7:57 PM Reply Quote 0
                    • S Offline
                      sdetweil @htilburgs
                      last edited by Jun 25, 2024, 7:57 PM

                      @htilburgs no rush at your availability.

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      H 1 Reply Last reply Jun 27, 2024, 6:03 PM Reply Quote 0
                      • 1
                      • 2
                      • 2 / 2
                      2 / 2
                      • First post
                        11/19
                        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