GithubHelp home page GithubHelp logo

chrismv48 / mmm-nowplayingonspotify Goto Github PK

View Code? Open in Web Editor NEW

This project forked from raywo/mmm-nowplayingonspotify

0.0 1.0 0.0 668 KB

A module for MagicMirror displaying the song currently playing on Spotify.

License: MIT License

JavaScript 73.00% CSS 4.35% HTML 22.65%

mmm-nowplayingonspotify's Introduction

MMM-NowPlayingOnSpotify

A module for the MagicMirror project by Michael Teeuw displaying the song currently playing on Spotify.

Maintainability Test Coverage Known Vulnerabilities Greenkeeper badge dependency status chat on gitter

How it works

After installing the module and configuring and setting up the Spotify app the module displays the song you are currently listening to on Spotify. It shows on which of your devices you’re playing the song. If you like you can also display the album cover.

To be able to display your currently playing song the module must connect to the Spotify service and query your private data. For obvious reasons this is not possible for arbitrary apps – or for that matter MagicMirror modules. There are third party solutions which will enable access to your Spotify data. This module is designed to be independent from third party services. Everything you need is in this module respectively is created by yourself.

Screenshots

Screenshot when nothing is playing Screenshot of a song playing without cover art Screenshot of a song playing with cover art
Nothing is playing. A song is playing and showCoverArt is set to false. A song is playing and showCoverArt is set to true.

Preconditions

  • MagicMirror2 instance
  • Node.js version >= 7
  • npm
  • a Spotify account

Installing

Installing the module is quite straight forward. Getting it to display your playing songs requires a bit more work.

Step 1 – Install the module

In your MagicMirror directory:

cd modules
git clone https://github.com/raywo/MMM-NowPlayingOnSpotify.git
cd MMM-NowPlayingOnSpotify
npm install

Step 2 – Create and authorise a Spotify app

In order to be able to connect to the Spotify API you need to create an app in the Spotify developer area. Then you need to authorise the app to access your personal data. Et voilà!

The module provides you with a special app which describes all the necessary steps and which guides you through the whole process. To use this app change into the authorization folder and start the app by typing node app.

cd authorization
node app

When the app is running you can access it by opening localhost:8888 in your browser. Provided you are doing this directly on your Raspberry Pi. If you want to access the app remotely just type the ip address or the name of your Raspberry like so for instance: http://raspi:8888. Then you should see the authorisation app like below.

Screenshot for authorisation app

Now just follow the steps described there. After successful authorisation the app will display a code snippet under the heading Step 3: Configure your mirror. Copy that snippet and paste it into your mirror’s config.js. Configure the rest to your needs and you’re good to go.

Updating

Go to the module’s folder inside MagicMirror modules folder and pull the latest version from GitHub and install:

git pull
npm install

Configuring

There is not very much to configure but here are the options:

Option Description
showCoverArt

A boolean value decribing whether an album cover photo should be displayed or not.

Type: boolean OPTIONAL
Example: false
Default Value: true

updatesEvery

An integer determining the interval for display updates.

Type: integer OPTIONAL
Example: 5
Default Value: 1

Note: With the default setting the display is updated every second. So when you skip to the next song it is virtually immediately visible. Also the progress bar runs smoothly. If you increase the value you may relieve the strain on your Raspberry’s processor but your display will not be as up-to-date.

clientID

A string describing the clientID of your Spotify app.

Type: string REQUIRED
Example: "acecg8a4..."
Default Value: none

Note: The easiest way to get that value is by copying the code snippet from step 3 in the authorisation app.

clientSecret

A string describing the clientSecret of your Spotify app.

Type: string REQUIRED
Example: "87978346..."
Default Value: none

Note: The easiest way to get that value is by copying the code snippet from step 3 in the authorisation app.

accessToken

A string describing the accessToken of your Spotify app.

Type: string REQUIRED
Example: "WaIO1987..."
Default Value: none

Note: The easiest way to get that value is by copying the code snippet from step 3 in the authorisation app.

refreshToken

A string describing the refreshToken of your Spotify app.

Type: string REQUIRED
Example: "HIuLH798..."
Default Value: none

Note: The easiest way to get that value is by copying the code snippet from step 3 in the authorisation app.

Here is an example for an entry in config.js

{
    module: "MMM-NowPlayingOnSpotify",
    position: "top_right",

    config: {
        showCoverArt: false,
        clientID: "<YOUR_CLIENT_ID>",
        clientSecret: "<YOUR_CLIENT_SECRET>",
        accessToken: "<YOUR_ACCESS_TOKEN>",
        refreshToken: "<YOUR_REFRESH_TOKEN>"
    }
}

Special Thanks

  • Michael Teeuw for inspiring me and many others to build a MagicMirror module.
  • The community of magicmirror.builders for help in the development process and all contributors for finding and fixing errors in this module.

Contributing

If you find any problems, bugs or have questions, please open a GitHub issue in this repository.

mmm-nowplayingonspotify's People

Contributors

raywo avatar greenkeeper[bot] avatar e3v3a avatar mookiies avatar mochman avatar

Watchers

James Cloos avatar

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.