Giter Club home page Giter Club logo

spotify-api-plusplus's Introduction

spotify-api-plusplus

A C++ wrapper for the Spotify Web API.

Building

First, install necessary dependencies, if you don't already have them.

sudo apt-get install cmake
sudo apt-get install libcurl4-openssl-dev

Clone the repository

git clone https://github.com/smaltby/spotify-api-plusplus.git

Initialize submodules

cd spotify-api-plusplus
git submodule update --init --recursive

And finally, build using CMake

mkdir build
cd build
cmake ..
make

Testing

Running the unit tests for spotify-api-plusplus is a bit more complex, because you'll need a client id, client secret, and refresh token. The first two can be gotten by registering an application with Spotify here.

The refresh token requires a Spotify Premium Account. Follow this guide up to step 5 to acquire a refresh token. Use the following scope

scope=user-read-private%20user-read-email%20playlist-read-private%20playlist-read-collaborative%20playlist-modify-public%20playlist-modify-private%20user-follow-modify%20user-follow-read%20user-library-read%20user-library-modify%20user-read-private%20user-read-birthdate%20user-read-email%20user-top-read%20ugc-image-upload%20user-read-playback-state%20user-modify-playback-state%20user-read-currently-playing%20user-read-recently-played

Once acquired, the refresh token should work indefinetely for running the test cases for this library.

Create 3 files under the root of the project, client_id.txt, client_secret.txt, and refresh_token.txt, containing the values you acquired previously. The test cases should be able to use them to sucessfully authenticate with Spotify and make calls to the API.

To run the test cases, simply use

make test

after going through the steps to build the library.

spotify-api-plusplus's People

Contributors

smaltby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spotify-api-plusplus's Issues

Offline Music

Hi,
Is it possible to download Songs to play them offline. (Like in the Spotify app)

BR,
Nico

Make CMake system more configurable

Specifically, it should have sufficient configuration that it can be called from an outside process, such as the Android NDK, without having to modify the internal CMake files.

Add Documentation

The code is currently completely undocumented and uncommented. It should be the opposite of that.

Throw exception containing Error model when appropriate

Currently, the Error model is unused, and the library just crashes whenever the web API sends an error. This should be resolved by throwing an exception containing the Error model when that happens, so users can catch that exception and handle it gracefully.

MyFollowedArtistsTest fails half the time

When running test cases, the MyFollowedArtistsTest fails about half the time, seemingly at random. It should be determined whether or not this is an issue with the test case, or if the follow/unfollow artist methods actually don't work on occasion.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.