Giter Club home page Giter Club logo

mmm-lastfm's Introduction

MMM-Lastfm

CodeQL

A module for MagicMirror² that displays the Last.fm scrobble currently playing.

Shown above is the module with layout: row, albumArtEffects: cd rotate and textLength: 100.

Installation

Just navigate to the modules directory of your MagicMirror² installation and clone this repository.

git clone https://github.com/RineshRamadhin/MMM-Lastfm.git

Prerequisites

Last.fm API key

To access the Last.fm API you'll first need to create an account on Last.fm. After you logged in you can create a new API account. Make sure you don't reuse this API account for other purposes due to rate limitations. Fill in the required fields (you can leave Callback URL and Application homepage empty) and hit save. Then copy the apiKey for your config. you can find an overview of API accounts (and their apikey) on the API accounts page.

Configuration

Example:

{
  module: "MMM-Lastfm",
  position: "top_left",
  header: "Now listening on Last.fm",
  config: {
    apiKey: "LASTFM_API_KEY",
    username: "LASTFM_USERNAME",
  }
},

Configuration Options

Option Type Default Description
layout string standard The layout to use. Left/right alignment will happen automatically. Possible options: [standard, row]
align string automatic How to align the chosen layout. Default value will dynamically be calculated based on the module position. Possible options: [left, right]
loadingText string Loading... The loading text to show while waiting for the first response from Last.fm.
apiKey string `` The Last.fm API key. See the Last.fm API key section for more info.
username string `` The Last.fm username. See the User-privacy section for more info.
activeInterval integer 10 How often to check for updates when listening to a song in seconds. This should be at least 10 seconds.
passiveInterval integer 60 How often to check for updates when not listening to a song in seconds. This should be at least 10 seconds.
passiveCount integer 5 How many times to stay in active mode after you stop listening to songs before switching to passive mode.
animationSpeed integer 1000 The fade effect speed between songs and showing / hiding the module in ms.
textLength integer 30 The maximum text length before cutting off.
albumArtEffects string `` A space-seperated list of effects to apply to the album art. Possible options: [grayscale, rounded, round, rotate[-slow/fast/reverse], cd]

API rate limits

Last.fm makes use of a fair use policy when it comes to API rate limits. In order to reduce the API calls made to Last.fm this module will try to combine API calls as much as possible. When two or more instances of the module are shown on a page, or multiple screens are used, behind the scenes a single fetcher will be used to retrieve data from Last.fm. Fetchers will be reused when instances have the following identical config options: apiKey, username, activeInterval, passiveInterval and passiveCount.

User privacy

In order to retrieve the Last.fm userdata your/their profile must have recent listening information public. This is required even if your API key and username are from the same account. You can check and update this setting on the Privacy page. Uncheck the Hide recent listening information option and hit save.

Screenshots

Standard layout (left) Standard layout (right)
Row layout (left) Row layout (right)
Album art effect Example
None
grayscale
rounded
round
round rotate
cd

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.