Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spotify-track-tonality

This project retrieves tonality data from Spotify's current playback.

Building

To build this project, please follow these steps:

Install the following dependencies:

Clone the repository:

git clone https://github.com/pasquale90/spotify-track-tonality.git

Build using CMake:

mkdir build
cd build
cmake ..
make

Docker

Alternatively you may use Docker to build and run the application:

docker build -t spotify-track-tonality:v1 .
docker run -it <image_id> /bin/bash

Usage

Upon successful compilation, two executables are generated:

  • authenticateUser: Facilitates user authentication with Spotify.
  • getCurrentTone : Retrieves the tonality of the current playback.

To use the application:

  1. Follow the instructions to create a Spotify Developer Application using the Spotify's dashboard.

  2. Configure credentials, by editing the spotify/credentials.json file, replacing the placeholders for client_id, client_secret, and redirect_uri.

{
    "client_id": "...",
    "client_secret": "...",
    "redirect_uri": "..."
}
hint
{
    "redirect_uri_example": "http://localhost/8080/callback"
}
  1. Run ./authenticateUser to authenticate your account with the Spotify API. During the first run, you will need to accept the access request, and paste the URL you've been redirected to into the command prompt, to complete the verification process. Upon successful verification, a refresh_token field will be added to the spotify/credentials.json file.
{
    "client_id": "your_client_id",
    "client_secret": "your_client_secret",
    "redirect_uri": "your_redirect_uri",
    "refresh_token": "your_refresh_token"
}
  1. Run ./getCurrentTone each time you want to retrieve the tonality of the current playing track.

Credits

Please note, this repository selectively adapts elements the foundational work of smaltby/spotify-api-plusplus.

Todo

  • Implement bug prevention when ads are playing.

  • [] Add KMS features

About

Retrieve tonality data from Spotify's current playback

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages