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

Bird of the day

Scheduled Pinned Locked Moved Entertainment
5 Posts 3 Posters 746 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.
  • C Offline
    cgillinger
    last edited by cgillinger Dec 3, 2024, 3:44 PM Dec 3, 2024, 3:43 PM

    My daughter is really interested in birds, so I thought it would be fun to create something bird-related for her. I came across a great API that provides bird facts and images, and decided to make a simple “Bird of the Day” module for MagicMirror². 🐦

    The module displays a random bird at a set interval using the Nuthatch API (https://nuthatch.lastelm.software/). The API is free, and you just need an API key to get started.

    Here’s an example of how it looks:

    
    

    d13a2f61-c2d8-4e07-b22a-f9478d483939-image.png

    You can customize the interval (weekly, daily, or hourly) and choose which bird facts to display, such as name, region, conservation status, or scientific name.

    If this sounds like something you’d enjoy, you can find the project on GitHub:
    👉 https://github.com/cgillinger/MMM-BirdOfTheDay/

    K 1 Reply Last reply Dec 4, 2024, 9:18 AM Reply Quote 4
    • K Offline
      KristjanESPERANTO Module Developer @cgillinger
      last edited by Dec 4, 2024, 9:18 AM

      Nice! Don’t forget to add it to the module list: https://github.com/MagicMirrorOrg/MagicMirror/wiki/3rd-party-modules 🦤

      C 1 Reply Last reply Dec 10, 2024, 12:57 PM Reply Quote 0
      • C Offline
        cgillinger @KristjanESPERANTO
        last edited by Dec 10, 2024, 12:57 PM

        @KristjanESPERANTO Ah, didn’t know there was a list! Will do asap, thnx!

        C 1 Reply Last reply Dec 14, 2024, 10:02 AM Reply Quote 1
        • C Offline
          cgillinger @cgillinger
          last edited by Dec 14, 2024, 10:02 AM

          And now cleaned the Github repo up a bit, also updated the module with some minor tweaks that I wanted to have (eg, position of text) and also added screenshots, the proper way.

          T 1 Reply Last reply Jan 27, 2025, 3:31 PM Reply Quote 1
          • T Offline
            tomdabom @cgillinger
            last edited by Jan 27, 2025, 3:31 PM

            @cgillinger

            We are really enjoying the Bird of the Day on the MagicMirror!

            Not sure if this was just a problem for me, but we were finding the same birds were being displayed and they were almost all ducks. I think the nuthatch API was always using the “Default value : 1” for page and “Default value : 25” for pageSize, so there were only 25 possible birds.

            With the pageSize of 25 I think there are a maximum of 15 pages in their database. I fudged my .js file like this, but there is probably a better was to do this, I’m not a developer. Something to consider for future updates

            getBird: function () {
                
                const randPage = Math.floor(Math.random() * 15) + 1;
                const endpoint = this.config.endpoint + "&page=" + randPage;
            
                fetch(endpoint, {
                    headers: { "api-key": this.config.apiKey },
                })
            
            1 Reply Last reply Reply Quote 1
            • 1 / 1
            • 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