🎵 Update a gist to contain your recently played songs on Spotify
- You need to create your own application on Spotify to manage integrations
- Edit settings for your app on Spotify dev dashboard, specifically, add a dummy
redirect_uri
. For my integration I've usedhttp://localhost/
you can use any other uri as per your choice.
Note: if you use a different uri, then please make sure you update this line with yours.
- Take note of your Spotify app's
client id
andclient secret
- Create a new public GitHub Gist
- Create a token with the
gist
scope and copy it - Generate an authentication code for your spotify account for using your newly created application by constructing this URL using your apps
client id
and your setredirect uri
(make sure it's url encoded) as values for the respective query params:
https://accounts.spotify.com/authorize?client_id=<YOUR-CLIENT-ID-HERE>&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%2F&scope=user-top-read%20user-read-recently-played
- Copy the generated code after the
code
query from the resulting response url query result which should look like this:http://localhost/?code=<COPY-EVERYTHING-HERE>
- Fork this repo
- Modify this line to your name or anything you want to title the gist as
- Log into CircleCI with your GitHub (https://circleci.com/vcs-authorize/)
- Click on "Add Projects" on the sidebar
- Set up a project with the newly created fork
- Go to Project Settings > Environment Variables
- Add the following environment variables:
- GIST_ID: The ID portion from your gist url
https://gist.github.com/<github username>/
6d5f84419863089a167387da62dd7081
. - GITHUB_TOKEN: The GitHub token generated above.
- SPOTIFY_CLIENT_ID: Your Spotify application client id
- SPOTIFY_CLIENT_SECRET: Your Spotify application client secret
- SPOTIFY_CODE: The code generated for you when you visited the constructed URL above in the last step of the prep work section
This repo is inspired by matchai's waka-box and john's strava-box