Update README

This commit is contained in:
Gabriel Augendre 2016-04-17 12:07:35 +02:00
parent a4197e474d
commit 347439cfd7

View file

@ -1,35 +1,15 @@
# Spotify Accounts Authentication Examples
# Spotify Duplicate Finder
This app lets you find duplicates in your Spotify playlists.
This project contains basic demos showing the different OAuth 2.0 flows for [authenticating against the Spotify Web API](https://developer.spotify.com/web-api/authorization-guide/).
## Deploy to Heroku
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
These examples cover:
## Usage
When using the application, you should first login with Spotify. The app only requests access to your private and collaborative playlists.
* Authorization Code flow
* Client Credentials flow
* Implicit Grant flow
After login, you can get all the playlists by clicking the `Get playlists` button. It may take a while if you have many ones.
## Installation
After playlists are loaded, you can click on any name to launch duplicates finding. This may also take a while as Spotify only allows me to retrieve tracks 100 by 100.
These examples run on Node.js. On [its website](http://www.nodejs.org/download/) you can find instructions on how to install it. You can also follow [this gist](https://gist.github.com/isaacs/579814) for a quick and easy way to install Node.js and npm.
Once installed, clone the repository and install its dependencies running:
$ npm install
## Running the examples
In order to run the different examples, open the folder with the name of the flow you want to try out, and run its `app.js` file. For instance, to run the Authorization Code example do:
$ cd authorization_code
$ node app.js
Then, open `http://localhost:8888` in a browser.
### Using your own credentials
The examples contains a working client ID and secret key. Note, however, that they might be rate limited if they are used frequently. If you are planning to create an application, we recommend you register your app and get your own credentials instead of using the ones in this project.
Go to [My Applications on Spotify Developer](https://developer.spotify.com/my-applications) and create your application. For the examples, we registered these Redirect URIs:
* http://localhost:8888 (needed for the implicit grant flow)
* http://localhost:8888/callback
Once you have created your app, replace the `client_id`, `redirect_uri` and `client_secret` in the examples with the ones you get from My Applications.
## Troubleshooting
If any request takes too much time, this may be because the token has expired. For the moment, no automatic refresh is implemented. You have to click the `Refresh token` button.