Jah'Spotify is a set of Java bindings over the Spotify native library (libspotify).
Java JavaScript C
Pull request Compare This branch is 172 commits behind johanlindquist:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Jah'Spotify Project

---- Introduction -----

Jah'Spotify is a simple Java wrapper built on top of the Spotify native APIs (libspotify)

Currently supports:

- retrieving library (all user playlists)
- retrieve a playlist
- retrieve an album
- retrieve a track
- retrieve an image
- add tracks to a queue
- play tracks
- pause/skip/play functions

All the above functions are accessible over a JSON based RESTful API.  This is very much work in progress and will
most likely change over time.

---- To build -----

Currently, Jah'Spotify only supports the Linux version of libspotify and will therefore require a Linux installation
to compile.  You also need to download and install libspotify & request an API key from Spotify.  This can be done
on the http://developer.spotify.com website.  Generate the key and download the C code version of it.  Place this
in a file called AppKey.h in the native/src/main/native/inc directory.  You may want to place some #ifndef APPKEY
statements in this to prevent linking problems.

Next, to build the sources, check 'em out from git

git clone git://github.com/johanlindquist/jahspotify.git
cd jahspotify
mvn clean install

---- Modules -----

- api: provides the basic operations for interacting with Jah'Spotify (and in turn libspotify)
- native: contains all native & JNI code interacting with libspotify
- web: provides the RESTful API (json based)
- web-client: provides java client for interacting with the RESTful API
- web-common: provides the java beans which are serialized over the RESTful API

---- REST API -----

To run up the Jah'Spotify RESTful API

mvn jetty:run -Dspotify.username=<your username> -Dspotify.password=<your password>


Library retrieval: http://localhost:8080/jahspotify/library/
Playlist retrieval: http://localhost:8080/jahspotify/playlist/spotify:user:dummy-user:playlist:0s8KIfDTmZz5zupnkqF6FO
Album retrieval: http://localhost:8080/jahspotify/album/spotify:album:3PogVmhNucYNfyywZvTd7F
Artist retrieval: http://localhost:8080/jahspotify/artist/spotify:artist:7dGJo4pcD2V6oG8kP0tJRR
Track retrieval: http://localhost:8080/jahspotify/track/spotify:track:7mliwEVqxIuwLmHdTXlBrx
Image retrieval: http://localhost:8080/jahspotify/image/spotify:image:e99e74261d120029fecfde36ab1c07a0eb99e54d
Adding a track to the play queue: http://localhost:8080/jahspotify/queue/add-to-queue/spotify:track:2WTn8V1SuH7peQSYJwrsiI
Retrieving play queue: http://localhost:8080/jahspotify/queue

While playing:

Skip to next track in queue: http://localhost:8080/jahspotify/controller/skip
Pause playback: http://localhost:8080/jahspotify/controller/pause
Resume play: http://localhost:8080/jahspotify/controller/play

There are other URLs - please examine the web module for them.

NOTE: You may have to setup your LD_LIBRARY_PATH to point to the libspotify & libjahspotify locations!
NOTE: You need to add the SpringSource Enterprise Bundle Repository to your maven configuration: http://ebr.springsource.com/repository/app/faq#q8