Skip to content

Commit

Permalink
Add examples and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
FoxxMD committed Nov 16, 2020
1 parent 7b45ad6 commit ce9e09c
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 4 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ config/currentCreds.json
config/maloja.json
config/spotify.json
config/config.json
/examples
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ A single-user, javascript app to scrobble your recent plays to [Maloja](https://
* Persists obtained credentials to file
* Automatically refreshes authorization for unattended use
* Implements back off behavior if no listening activity is detected after an interval (after 10 minutes of idle it will back off to a maximum of 5 minutes between checks)
* Displays running status and buffered log through web server

## Installation

Expand Down Expand Up @@ -91,6 +92,8 @@ On first startup you may need to authorize Spotify by visiting a callback URL. T
https://localhost:9078/authSpotify
```

Connection status and a buffered log of the last 50 events can be viewed at the root url: `https://localhost:9078`

### Running Directly

```
Expand All @@ -105,11 +108,9 @@ node index.js
| `LOG_DIR` | Volume | `/home/node/app/logs` |
| `PORT` | Port | 9078 |

EX
## Examples

```
docker run ... -v /path/on/host/config:/home/node/app/config ...
```
[See minimal configuration examples in the examples folder](https://github.com/FoxxMD/spotify-scrobbler/tree/master/examples)

## License

Expand Down
36 changes: 36 additions & 0 deletions examples/examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Minimal Configuration

Examples assume you have registered a Spotify application with the default callback url of `http://localhost:9078/callback`.

If you use another callback url or domain name you will need to specify at a minimum `SPOTIFY_REDIRECT_URI`.

## Using Environmental Variables

### Local
```
SPOTIFY_CLIENT_ID=yourId SPOTIFY_CLIENT_SECRET=yourSecret MALOJA_URL=http://domain.tld MALOJA_API_KEY=1234 node index.js
```

### Dockerhub

Note: I do not recommend running a container without a `config` volume specified or you will need to reauthorize the app everytime the container is rebuilt.

```
docker run -e "SPOTIFY_CLIENT_ID=yourId" -e "SPOTIFY_CLIENT_SECRET=yourSecret" -e "MALOJA_URL=http://domain.tld" -e "MALOJA_API_KEY=1234" foxxmd/spotify-scrobbler
```

## Using Configuration

Reference the [example json configs.](https://github.com/FoxxMD/spotify-scrobbler/tree/master/config)

### Local

```
node index.js
```

### Docker

```
docker run -v /path/on/host/config:/home/node/app/config foxxmd/spotify-scrobbler
```

0 comments on commit ce9e09c

Please sign in to comment.