MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. tomdabom
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    T
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 1
    • Groups 0

    tomdabom

    @tomdabom

    1
    Reputation
    1
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    tomdabom Unfollow Follow

    Best posts made by tomdabom

    • RE: Bird of the day

      @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 },
          })
      
      posted in Entertainment
      T
      tomdabom

    Latest posts made by tomdabom

    • RE: Bird of the day

      @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 },
          })
      
      posted in Entertainment
      T
      tomdabom