• 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 13.5k 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.
  • S Away
    sdetweil @htilburgs
    last edited by Mar 20, 2019, 9:56 PM

    @htilburgs make a table with HTML.

    tr have to be added to table for each row
    And td need to be added for each tr

    Right? Exactly the same using code

    Sam

    How to add modules

    learning how to use browser developers window for css changes

    1 Reply Last reply Reply Quote 0
    • ? Offline
      A Former User @htilburgs
      last edited by Mar 20, 2019, 9:58 PM

      @htilburgs
      https://www.w3schools.com/jsref/dom_obj_table.asp
      This might be help. Read following articles about table on that site.

      1 Reply Last reply Reply Quote 0
      • H Offline
        htilburgs
        last edited by htilburgs Mar 21, 2019, 8:35 AM Mar 21, 2019, 6:34 AM

        @Sean @sdetweil I finaly figured it out! Thanx for the support and pointing me in the correct direction. See the result:

        alt text

        		var MPT = this.MPT;
        
        		// creating the tablerows
        		// Fajr
        		var FajrRow = document.createElement("tr")
        		FajrRow.className = "small fajr-row";
        		
        		var FajrTextCell = document.createElement("td");
        		FajrTextCell.innerHTML = "Fajr";
        		FajrRow.appendChild(FajrTextCell);
        		table.appendChild(FajrRow);
        		
        		var FajrTimeCell = document.createElement("td");
        		FajrTimeCell.className = "bright";
        		FajrTimeCell.innerHTML = MPT.Fajr;
        		FajrRow.appendChild(FajrTimeCell);
        		table.appendChild(FajrRow);
        		
        		var FajrArabCell = document.createElement("td");
        		FajrArabCell.innerHTML = "الفجر";
        		FajrRow.appendChild(FajrArabCell);
        		table.appendChild(FajrRow);
        ......
        }		
        		return table;	
        

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

        1 Reply Last reply Reply Quote 0
        • S Away
          sdetweil
          last edited by Mar 21, 2019, 10:49 AM

          Fabulous! Nice work!

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • H Offline
            htilburgs
            last edited by Mar 21, 2019, 11:31 AM

            @Mykle1 Thanks for the MMM-UFO “templates”. This really helped me to get started.
            First one down, several to go…:winking_face:

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

            M 1 Reply Last reply Mar 21, 2019, 8:50 PM Reply Quote 0
            • M Offline
              Mykle1 Project Sponsor Module Developer @htilburgs
              last edited by Mar 21, 2019, 8:50 PM

              @htilburgs

              You’re welcome, mate. And with @sdetweil and @Sean you found the best help possible. :thumbsup:

              Create a working config
              How to add modules

              1 Reply Last reply Reply Quote 0
              • B Offline
                betle
                last edited by May 31, 2019, 4:45 PM

                Thanks tipobet

                1 Reply Last reply Reply Quote 0
                • R Offline
                  rick93
                  last edited by Dec 27, 2020, 2:57 PM

                  Hi @Mykle1 , i am impressed with your MMM-UFO template.
                  Unfortunately the link -->https://ufo-api.herokuapp.com/api/sightings/search?city=new york&state=ny&limit=50&skip=0 seem like down.

                  Could you please have a look at it? so that I could refer to.

                  Thanks!!

                  M 1 Reply Last reply Dec 28, 2020, 12:52 AM Reply Quote 0
                  • 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
                      • 1
                      • 2
                      • 3
                      • 4
                      • 5
                      • 3 / 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