A MagicMirror Module that displays recent releases from your favorite Spotify artists.
This module depends on the Spotify API. To use this free API we'll be needing a Key.
The steps below will show you how to get such a key.
How to install?
1. In your MagicMirror directory:
cd modules
git clone https://github.com/Ruud14/MMM-SpotifyReleases.git
cd MMM-SpotifyReleases
npm install
2. Register this module as an app in the Spotify developer area. Complete the following steps to do so:
- Go to the Spotify developer area
- login and press the green "Create an app" button in top right corner.
- Fill in the form:
- App name: MMM-SpotifyReleases
- Check both checkboxes.
- Press "Create".
The next page that opens shows you your Client ID and Client Secret. We will be needing those later.
- Press the green "Edit Settings" button in top right corner.
- Add the following URL to the 'Redirect URIs':
http://<LOCAL IP OF MIRROR>:8888/callback
where<LOCAL IP OF MIRROR>
should be replaced with the local IP address of your mirror.
3.
Get your Spotify accessToken and refreshToken.
There are multiple ways of doing this, following the steps below is one of them:
In your MagicMirror directory:
cd modules/MMM-SpotifyReleases/Token_Get
node app.js
- Now access
http://<LOCAL IP OF MIRROR>:8888
. (where again<LOCAL IP OF MIRROR>
should be replaced with the local IP address of your mirror.) - Fill in your client ID and client Secret.
- Press "Generate Access and Refresh token.".
- Log in to Spotify.
- Your access token and refresh token will be shown after logging in. We will be needing these in the next step.
4. Get your favorite Spotify artist's IDs.
- Go to artist's profile.
- Click the button with the three dots.
- Click the share button.
- Choose to copy the Spotify-URIs. You'll get something like this:
spotify:artist:246dkjvS1zLTtiykXe5h60
. - remove
spotify:artist:
and what is left is artist's ID.
5. Put the following code into MagicMirror/config.js
{
module: 'MMM-SpotifyReleases',
position: "bottom_left",
config: {
header: "New releases from your favorite artists!",
useHeader: true,
animationSpeed: 3000,
updateInterval: 60 * 60 * 1000,
maxWidth: "500px",
visibleReleasesAmount: 7,
accessToken: "<YOUR ACCESSTOKEN>",
refreshToken: "<YOUR REFRESHTOKEN>",
clientID: "<YOUR CLIENT ID>",
clientSecret: "<YOUR CLIENT SECRET>",
artists: [
"246dkjvS1zLTtiykXe5h60", // Post Malone
"6eUKZXaKkcviH0Ku9w2n3V", // Ed Sheeran
],
}
}
Option | Description |
---|---|
header |
Optional string The text above the list with releases (See image). |
useHeader |
Optional boolean Whether the header is shown or not. |
animationSpeed |
Optional integer Fade in and out speed. (in ms) |
updateInterval |
Optional integer Time between Spotify API calls. (in ms) |
maxWidth |
Optional string The width of the screen area occupied by the module. |
visibleReleasesAmount |
Optional integer The amount of releases displayed. This is also responsible for the height of the screen area occupied by the module. |
accessToken |
Required string Your access token (From step 3). |
refreshToken |
Required string Your refresh token (From step 3). |
clientID |
Required string Your client ID (From step 2). |
clientSecret |
Required string Your client Secret (From step 2). |
artists |
Required list of string sList of all the artist IDs. (From step 4) |
Feel free to contact me here if you have any questions, problems, or feature requests.