One GET request to like the playing track and add the album tracks to various playlists, just like me whenever an awesome track shows up on Spotify.
Whenever the /like
endpoint is requested, the server will:
./config.js
Go to Spotify Dashboard and create a new app. Make note of the Client ID and the Client Secret. Click edit settings and in Redirect URIs add the URL where the server will be hosted suffixed with /callback
.
Example
http://192.168.1.10:50000/callback
Make sure to save afterwards.
Make sure to clone the repository:
git clone https://github.com/oscarb/spotify-like-me.git
Create a .env
-file and configure it similar to .env.sample
. Do the same for ./config.js
where a list of playlists to update goes.
Build container
docker build . -t oscarb/spotify-like-me
Start the container
docker run -v /path/to/local/spotify-like-me:/usr/src/app -p 50000:8080 --env-file ./.env -d oscarb/spotify-like-me
Follow these simple steps to have the server connect to your Spotify account.
Voila! π The server should now be authorized on behalf of your account and ready to start liking songs and manage playlists for you.
As of now, there's no security built-in so if your server is exposed to the internet it means that anyone could in theory start liking tracks you currently listen to. Either make sure the server is only reachable in the local network and used locally or set up some proxy server which handles security for you.
GET
request to http://localhost:5000/like
Some suggestions on how this can be used.
Get a Flic button and set it up to do a GET request to /like
whenever the button is clicked, double-clicked or held. No more need to be nearby a phone or computer to make sure that aweseome track doesn't go unnoticed!