Skip to content

Commit

Permalink
edit readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ericdaat committed Jul 11, 2019
1 parent 97d5c80 commit 1114db1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ PYTHON=${VENV_NAME}/bin/python3

export PYTHONPATH="."

init-db:
PYTHONPATH="." python scripts/init_db.py

tests:
python -m unittest discover -s tests;

Expand Down
30 changes: 21 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# kshe-to-spotify

[![CircleCI](https://circleci.com/gh/ericdaat/kshe-to-spotify.svg?style=svg)](https://circleci.com/gh/ericdaat/kshe-to-spotify)

As a big fan of Classic Rock living in France, I am very frustrated by the
lack of good classic rock radio we have. I spent four months in St Louis, MO,
and I had the chance to listen to [KSHE 95](http://www.kshe95.com/) every day,
Expand Down Expand Up @@ -33,26 +35,36 @@ First, you'll need to setup your Spotify developer account, and register an app.
Find how [here](https://developer.spotify.com/web-api/).
Once your app is created, you will have access to the following crendentials:

- client_id
- client_secret
- redirect_uri
- `client_id`
- `client_secret`
- `redirect_uri`

The app will need those to update tracks to your playlist.

Copy the file `.spotify-token.json.dist` into `.spotify-token.json`
and fill in these credentials. You will also need your spotify *user-id*
(your username) and the *playlist-uri* to which you'll upload the tracks to.
and fill in these credentials. You will also need to add:

- Your spotify *user_id* (your username)
- The *playlist_id* to which you'll upload the tracks to
(e.g mine is `3BCcE8T945z1MnfPWkFsfX`)

Once you're good, follow these commands to start the server.
Once you're good, install the requirements in a virtual environment:

``` shell
pip install virtualenv
pip install virtualenv # if you don't have it already
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
uwsgi wsgi.ini
```

The app should now be running on `localhost:9999`.
The app uses an `sqlite` database to store all the songs it has downloaded so far. You have to initialize the database running this command: `make init-db`.

Here are the required steps to update your playlist with
the latest songs from the KSHE radio:

- First, launch the server: `make start-api`. The app should now be running on `http://localhost:9999`.
- Then, open your browser and go to `http://localhost:9999/auth` to authenticate to Spotify.
- Finally, run `make update-playlist` to get the latest songs in your playlist.

## API

Expand Down

0 comments on commit 1114db1

Please sign in to comment.