• 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.

Develop module with API

Scheduled Pinned Locked Moved Development
42 Posts 6 Posters 14.2k Views 6 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.
  • M Offline
    Mykle1 Project Sponsor Module Developer @rick93
    last edited by Dec 28, 2020, 12:52 AM

    @rick93 said in Develop module with API:

    Could you please have a look at it?

    Well, I just took a look at the api and it is down, as you already discovered. There is nothing I can do about that. However, I will take a look around and see if I can find another. Unknown if I will be able to find one but give me some time. No promises. I will do my best.

    Create a working config
    How to add modules

    R 1 Reply Last reply Dec 28, 2020, 2:32 AM Reply Quote 0
    • R Offline
      rick93 @Mykle1
      last edited by Dec 28, 2020, 2:32 AM

      @Mykle1 thanks for your prompt reply and support. I am looking at your API information to compare with your tutorial in the module so that I know what parameter to change. It’s fine if you can share the API’s data/code, doesn’t really need to repair the link or find another. let me know if you can recall back from any previous code in storage. Appreciate!

      M 1 Reply Last reply Dec 28, 2020, 11:56 PM Reply Quote 0
      • M Offline
        Mykle1 Project Sponsor Module Developer @rick93
        last edited by Dec 28, 2020, 11:56 PM

        @rick93 said in Develop module with API:

        It’s fine if you can share the API’s data/code, doesn’t really need to repair the link or find another.

        I’m not really sure what you are asking me for. The API is dead so there is nothing that I can give you. The link is good but the API is dead so there is no repairing it. :-/

        Create a working config
        How to add modules

        R 1 Reply Last reply Jan 1, 2021, 2:40 PM Reply Quote 0
        • R Offline
          rick93 @Mykle1
          last edited by Jan 1, 2021, 2:40 PM

          @Mykle1 said in Develop module with API:

          @rick93 said in Develop module with API:

          It’s fine if you can share the API’s data/code, doesn’t really need to repair the link or find another.

          I’m not really sure what you are asking me for. The API is dead so there is nothing that I can give you. The link is good but the API is dead so there is no repairing it. :-/

          @Mykle1 Understood. I am actually trying to create my module for the Singapore weather forecast via API --“https://api.data.gov.sg/v1/environment/4-day-weather-forecast”.
          I am new to MM as well as JS, so I do like to learn the way you code for the API, so I can get the idea to code my own.
          Anyway, I will find another example to continue my coding.
          Thanks.

          M 1 Reply Last reply Jan 1, 2021, 3:18 PM Reply Quote 0
          • M Offline
            Mykle1 Project Sponsor Module Developer @rick93
            last edited by Jan 1, 2021, 3:18 PM

            @rick93 said in Develop module with API:

            I am new to MM as well as JS, so I do like to learn the way you code for the API, so I can get the idea to code my own.
            Anyway, I will find another example to continue my coding.

            First, you should aspire to learn how others code. I have a basic understanding of coding but I manage to make things work, usually. Only with the help and guidance of others have I managed to create some modules. Anyway . . .

            The url you have for the weather data is working. Great! I took the data and ran it through the json viewer. I assume you did the same as per the instructions in the UFO module readme. By substituting the url and changing some naming in the node helper and js file you should be able to get the data. Setting up the divs should not be too hard either.

            See what you can manage on your own and I will try to help you when you get stuck.

            Paying it forward.

            Peace!

            Create a working config
            How to add modules

            1 Reply Last reply Reply Quote 1
            • M Offline
              Mykle1 Project Sponsor Module Developer
              last edited by Jan 1, 2021, 3:19 PM

              Screenshot from 2021-01-01 10-03-14.png

              Create a working config
              How to add modules

              R 1 Reply Last reply Jan 17, 2021, 10:57 AM Reply Quote 1
              • R Offline
                rick93 @Mykle1
                last edited by Jan 17, 2021, 10:57 AM

                Hi @Mykle1 , I am trying to display only one parameter on the magic mirror,unfortunately it show undefined. I tried different ways but still cant make it.
                I don’t not know what is the root cause since I was using MMM_UFO as my template. Do you mind to have a look on my module and advice me?
                Thank you very much.
                https://github.com/rick0222/MM-SW

                a16bb0c1-a7a0-4d7a-9874-a22b02b995b8-image.png

                R 1 Reply Last reply Jan 17, 2021, 1:14 PM Reply Quote 0
                • R Offline
                  rick93 @rick93
                  last edited by Jan 17, 2021, 1:14 PM

                  @rick93 said in Develop module with API:

                  Hi @Mykle1 , I am trying to display only one parameter on the magic mirror,unfortunately it show undefined. I tried different ways but still cant make it.
                  I don’t not know what is the root cause since I was using MMM_UFO as my template. Do you mind to have a look on my module and advice me?
                  Thank you very much.
                  https://github.com/rick0222/MM-SW

                  a16bb0c1-a7a0-4d7a-9874-a22b02b995b8-image.png

                  rick93 about 2 hours ago
                  I am not sure is the issue came from the API that I inserted not correct and return a wrong data. but I have no idea how I can make it work.

                  this.url = "https://api.data.gov.sg/v1/environment/4-day-weather-forecast";
                  		this.SW = [];
                  
                  M 2 Replies Last reply Jan 17, 2021, 11:26 PM Reply Quote 0
                  • M Offline
                    Mykle1 Project Sponsor Module Developer @rick93
                    last edited by Jan 17, 2021, 11:26 PM

                    @rick93

                    Ok, I’ll take a look at it. :-)

                    Create a working config
                    How to add modules

                    1 Reply Last reply Reply Quote 1
                    • M Offline
                      Mykle1 Project Sponsor Module Developer @rick93
                      last edited by Jan 18, 2021, 12:10 AM

                      @rick93

                      Give me your email in a private chat message and I’ll send you the fixed files.

                      You’re doing well. Don’t worry about making mistakes or being new. Everyone here has, at one time or another, been right where you are. I still struggle with coding. I’m just too old and too stupid to stop trying.

                      Create a working config
                      How to add modules

                      R 1 Reply Last reply Jan 24, 2021, 3:05 AM Reply Quote 1
                      • 1
                      • 2
                      • 3
                      • 4
                      • 5
                      • 4 / 5
                      • 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