cmd | ||
internal | ||
.dockerignore | ||
.gitignore | ||
docker-compose.yml | ||
Dockerfile | ||
go.mod | ||
go.sum | ||
Makefile | ||
README.md |
Morning alarm
A simple alarm clock that plays a random song from a playlist at a given time on you Spotify device of choice. Basicly a cronjob for Spotify.
Setup
- Create a new Spotify app at https://developer.spotify.com/dashboard
- Give it a name and description
- The redirect URI should be a valid URL as it will be used as a callback. (Only needs to accsessable from your local machine). The redirect URI should be the same as in the config.
- Copy the client ID and client secret and paste them in the config.
- Set the device ID to the device you want to play the music on. You can keep this empty if you don't know the device ID. You can retrieve it later via the API. (GET /api/device)
- Get the playlist ID of the playlist you want to play. You can get the playlist ID by right clicking on the playlist in the Spotify app and selecting "Share" and then "Copy link to playlist". Then grab the id from the URL (The part behind
/playlist/<id>
) . e.g.0MJBni0UzdnML1amikx0Rc
. Paste the playlist ID in the config. - Set the redirect URI in the config.
- Start the app and look in the console for the URL to authorize the app. Open the URL in your browser and authorize the app.
- If you have not already set the device ID, you can do so now. (GET /api/device). Don't forget to restart with the new device ID.
- Test the app by calling the API (POST /api/trigger). This should play a random song from the playlist on the device you selected.