/Spotiserv

Listen to Spotify on a sevrer

Primary LanguageRuby

Spotiserv

Hello, and welcome to Spotiserv.

Alt text

You will need a couple of things to make this work proper:

And that is it, now you are good to go!

This is a spotify-server that plays music from spotify by adding them to a temporary playlist. Anyone that is connected to the network can send spotify-uri's to the server and have them added to a temporary playlist that the server will play from, if you have any problems of ideas to the server, don't hasitate to contact me on github and I will add them to the server.

The real purpose for this is at pre-parties (förfest in swedish) when you really dont have a good way of playing music together, you either just have someone occupying a computer chair all evening.

Spotiserv is made of different pieces:

I have only mashed up these to create a server, Spotiserv: https://github.com/SebastianThorn/Spotiserv To start the server, simply type './start' in a linux console that have ruby, libspotify and the required gems.

The server anwsers to the following HTTP-GET requests:

  • /add/<USER>/<SPOTIFY-TRACK-URI> Returns an xml-file if successful, and adds the track to the URI to the playlist.
  • example: 192.168.0.189:8001/add/Sebastian/spotify:track:648j5ND8kMFMYXUGMWs5KP
  • / Returns an html-page that renders the playlist into a table and populates it with the data from /queue.xml
  • /queue.xml Returns the current playlist as an xml-file
  • /next Returns an xml-file if successful, and changes the current track to the next in the playlist.

How to run on RPi, raspberrian (Soft-float!)

Now you need to download the key-file from spotify, you can get it here: http://developer.spotify.com/technologies/libspotify/

Place it in ~/Git/Spotiserv/ Now you should be good to go with the server on a RPi running Raspbian.

./start.rb [<username> [<password>]]

Now it's time to play some good music!

http://<IP:PORT>/add/Sebastian/spotify:track:6bOTe8T116DNpwp2H6Hxgh

TODO's

  • Add some sort of pause/play-toogle to the webserver
  • Comment the code
  • Add a Gemfile

Known Issues

  • While running this on RPi, you might have some playback issues, and might stop at some times.
  • There seems to be aome issues with spotify-accounts linked to facebook (needs verification).
  • IE will cache the xml-file, and therefore wont display the playlist at the index-page.