This web application uses the Spotify API to find an artist's genre and generates a playlist with top-tracks by artists with the same genre.
- Download the ZIP file
- Unzip the ZIP file
- Make sure you install all neccesary prerequisites (see below)
Make sure you have Ruby installed:
- ruby version: 2.3.1
And run:
$ bundle
To install the gems that the app depends on:
- sinatra
- rspotify
- rack version: ~> 2.0, >= 2.0.3
- sinatra-static-assets version: ~> 1.0, >= 1.0.4
- http
- json
This app uses a Client ID and Secret Key. These are used as environment variables. To get these and to be able to use the Web API, the first thing you will need is a Spotify user account (Premium or Free). To get one, simply sign up at www.spotify.com.
When you have a user account, go to the My Applications page at the Spotify Developer website and, if necessary, log in. Accept the latest Developer Terms of Use to complete the set-up of your account.
Follow this Spotify tutorial to get your Client ID and Secret Key.
Then, to start up the app, in your terminal type:
$ clientsecret=YOURCLIENTSECRET clientid=YOURCLIENTID ruby application.rb
The app should now be running locally.
- Spotify API - The API used.
- Sinatra - The DSL used.
- Ruby - The language used.
- rspotify - A ruby wrapper for the Spotify Web API.