Spoti-Stats is a C++ command line application which utilizes the Spotify Web API and allows you to search songs, tracks, albums, etc.
- Use HTTP methods to communicate with API
- Implement solid practices through the use of OOP, design patterns, and practice other basic programming principles
- cpprestsdk (https://github.com/microsoft/cpprestsdk) :
cpprestsdkfrom Microsoft used for Client/Server connection and oAuth authorization - libcurl (https://curl.se/libcurl/) :
libcurlallows the use of CRUD methods to communicate with the Spotify API - nlohmann/json (https://github.com/nlohmann/json) :
nlohmann jsonAPI allows for easy JSON manipulation in C++
-
cpprestsdkandnlohmann json- On MacOS:
$ brew install nlohmann-json cpprestsdk - On Linux:
$ sudo apt-get install nlohmann-json-dev
- On MacOS:
-
libcurl:- Install
curl:
Homebrew:$ brew install curl
or
Manually: Download package from: https://curl.se/download.html - If any compilation errors occur, try setting:
$ export LDFLAGS="-L/usr/local/opt/curl/lib" $ export CPPFLAGS="-I/usr/local/opt/curl/include"
- Install
- Clone the Spoti-Stats repository:
$ git clone https://github.com/michaeldillahunty/Spoti-Stats-cpp.git $ cd Spoti-Stats-cpp$ mkdir build$ cd build- On MacOS:
Run$ cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/Cellar/openssl/1.0.2s/lib ..to get all necessary dependencies make: will create 2 executable files:serverandspotify- Run the executable file(s)
a. To run in Guest Mode (no login required) - Use:$ ./spotify
b. To run in User Mode (requires Spotify login and authentication):
a. Run$ ./server
b. Open another terminal instance and navigate to the samebuilddirectory
- In the second instance run$ ./spotify