söndag 1 november 2009

Experimental .NET library for Spotify metadata API

Today I started to experiment with the new Spotify metadata API (http://developer.spotify.com/blog/archives/2009/10/26/launching-the-metadata-api/).

I have some ideas of what to use it for, but regardless of type of future project I need to have some sort of adapter library for communicating with Spotify.

So, today I started on that library which is basically only a small object model  for deserializing the XML into and a standard webrequest to Spotify. Nothing fancy but "nice to have" code when continuing with making applications that make use of that information.

I am posting this here for others to use/continue working on.

Available methods

(Click to enlarge) Interface isn't used at this time since there is only 1 "endpoint" today. It is just there for future versions when there might be others (i.e. WCF).

The only thing needed in order to run this are 2 things;

1. Configuration file
Furillo.Integration.Spotify.config contains the configuration for the service. Nothing needs to be changed here, the values are only abstracted from code for future changes from Spotify. This file can be placed anywhere, its place just has to be set in the application file configuration file. Example for web application (web.config);

(Click to enlarge)

2. Reference the assembly and instantiate the Service.
Make a reference to the Furillo.Integration.Spotify.dll in your project and instantiate the class to access the methods;
var service = new Furillo.Integration.Spotify.SpotifyService();

Download
This code is hardly tested, consider it a beta, and it is provided "as is". No functionality guaranteed. The code is licenced under GNU LGPL (Lesser General Public License).

Binaries
Furillo.Integration.Spotify.zip (12kb, dll, pdb, config)

Source code (Visual Studio 2008, C#, .NET 3.5)
Furillo.Integration.Spotify_Src.zip (19kb, Class Library and stripped Web Application Project)

// Rickard