Hunch

22

Easy data visualization with WebKit

November 26 by Rasmus Andersson, tagged cocui, spotify, visualization and real-time, filed under software

At Spotify, we recently put up two large TV screens on the walls of our Stockholm office (most R&D is done there). The idea is to visualize & communicate that “stuff is happening” without actually revealing any critical data (since a lot of external people are visiting the office).

Today me, Andreas Öman and Emil Hesslow — fellow Spotifiers — kicked off a cozy little Hack Night at the office, trying to create something simple yet impressive to have running on one of the TV screens.

We ended up writing a real-time search query visualization in just about a few hours. It looks like this and is smoothly animated:

Screen shot

Try a demo version here… (Tested in Safari, iPhone, Firefox and Chrome).

How did we manage to build a real-time scalable system and high-performance viz in such an awfully short time?!

Hack nightWell, for starters we used WebKit through Cocui which instantly gave us full screen high-performance hardware-accelerated drawing (yes, it’s a long sentence with cool words but those things shouldn’t be taken for granted).

But… where does the data come from? From the internets? — Not really, but it sure travels in internets-style. We use a dumb pub/sub message queue. In one end a client (the WebKit/Cocui app in HTML/JavaScript) is listening (subscribing). In the other end one of our search servers are pushing messages into the queue in batches.

[batch of search queries during last minute]
                   ||
                   ||
                   \/
             [message queue]
              ||        ||
              ||        ||
              \/        \/
           [client]  [client]

The client simply enqueues these search queries when they are delivered while at the same time dequeueing search queries. We do it this way (batches and a queue) because we simply have too high rate of searches. It would be almost impossible to read anything if we actually sent every single message. To give the feeling of real time we use a random delay when dequeueing queries.

When a query is dequeued it’s formatted into a chunk of HTML (a div and an a tag) and then prepended to the body using jQuery with animated effects.

Don’t forget to try the demo version (Does not work in Internet Explorer) which is simply the client without any real-time data. Note that this demo uses static data for demonstration purposes, not an actual real-time stream. The real-time data stream is only available within our office and thus not available for public use.

Update: Successfully tested with iPhone, Firefox and Chrome — thank you readers!

Here’s the full Cocui demo application: sptv1-demo-cocui-app.zip (for Mac OS X 10.5 and newer).

3

First ever Spotify commercial TV ad

October 26 by Rasmus Andersson, tagged spotify, advertising, video and tv

Our/Spotify’s first ever commercial television advert premieres today on Kanal 5 in Sweden.

Production by the amazing guys at Identity Works (including Carl & Kaj formerly known as Superstrikers).

Here you also get a sneak peek of our upcoming new typeface Spotify Akkurat ;)

4

Improving the Spotify installation experience

October 24 by Rasmus Andersson, tagged spotify, mac and ux, filed under software

At the time of writing this, we distribute Spotify for Mac OS X as a regular DMG (disk image). The user experience is not really what I would call smooth:

  • Download the DMG file.
  • Open the DMG (implicitly mounting the disk image. Safari does this for you, BTW).
  • Move Spotify to the Applications folder.

Now, for a unexperienced user double clicking the app icon inside the DMG feels like a natural action. It’s there, I’ll just open it then. Later, she restarts her computer, the DMG gets unmounted and “Hey, where’s Spotify?”.

Our solution is to use an internet-enabled disk image which automatically unpacks Spotify upon download. We then use some magic in the app to check if it was launched from another place than the Applications folder.

Continue reading...

2

Happy birthday, Spotify.app!

October 7 by Rasmus Andersson, tagged spotify and anniversary

Today (Oct 7th, 2009) was the 1 year anniversary of the Spotify desktop client. We celebrated with cake, of course.

Spotify birthday cake

One year ago we pushed the button, releasing www.spotify.com and the first public, official desktop client application.

Pushing The Button

It was a big day for all of us at Spotify — after two years of hard work and a lot of coffee we could finally offer our creation to the world.

This is what the first version looked like:

spotify-desktop-client-oct-2008

2

Spotify for the iPhone

July 27 by Rasmus Andersson, tagged spotify, software and iphone, filed under software

Late last week we put the finishing touches to a very special project we’ve been wanting to share with you for a while now. After many weeks of burning the midnight oil at Spotify HQ in an effort to squeeze into it every drop of musical goodness, we’ve finally completed work on the Spotify app for the iPhone and sent it over to the nice people at Apple.

We also wrote about this in the Spotify blog and BCC picked it up (on their front page news).

Here’s the playlist we used in the video: Spotify iPhone preview video, July 27, 2009.

Spotify on the Android

May 27 by Rasmus, tagged android, demo, google, mobile, preview, software, spotify and video, filed under software

We presented the Spotify mobile app for Android at the Google IO developer conference yesterday. What you see is work in progress and not the final product. We’ll put some finishing touches on the graphics as well as tweaking the code.

A wee bit more info can be found in our blog: Spotify mobile demo at Google Android I/O.

1

Write your own Spotify client

April 7 by Rasmus, tagged api, libspotify, software, spotify and spotify core, filed under software

spotify-core-logoWe just released libspotify – The Spotify Core library – into the wild. This will enable anyone to write their own Spotify client application.

libspotify is a C library which exposes all the features of the regular desktop application, except from the user interface – that, you have to write yourself ;). Now, of course there’s a catch: You have to have a Spotify premium account in order to use the library. But as the music-loving Spotify user you are, you’re already a Premium user, right? right?!.

First off, you need to apply for a application key which will be used to identify your application in our system. Then off to the download section and grab a copy of this funky library (the link that says something like “tar.gz”). This package includes all you need to get started – the compiled library, documentation, example code, the Spotify Core logotype as well as a copy of the terms of use.

At the moment, only Linux on IA-32 (Intel Architecture, 32-bit) is supported. Our goal is to support a host of additional platforms in the future.

The API have two distinct features: Objects, or structs, are reference counted using functions named like sp_<type>_{release,retain}. Second; you have to establish a sp_session object before calling any of the other library functions. Basically, you log in and receive a context object which is then passed around to the different library function calls.

The examples which are provided with the downloadable package can also be viewed on the website.

You should also read our brand new official Developer Blog at http://developer.spotify.com/blog/. Here’s the official post announcing libspotify.

Human version of Spotify

January 9, 2009 by Rasmus, tagged comic, humor, spotify and stockholmsnatt

Stockholmsnatt strip

The recurring comic Stockholmsnatt jokes about Spotify. (Also in SVD) Swedish only – sorry.

Peace & Love & Spotify

December 2, 2008 by Rasmus, tagged deal, festival, music, partnership and spotify

peaceandlovespotify

Visit the Peace & Love festival and get a free Spotify account.

PS. Don’t forget about the nice little gift Premium Users receives during december. DS.

3

Smisk in Spotify

November 24, 2008 by Rasmus, tagged python, smisk, software and spotify, filed under software

Smisk

Spotify replaced Twisted with Smisk for one of its backend services, which marks the first serious deployment of Smisk! Version 1.1 is soon to be released and will be announced on smisk-announce as well as in this blog.

Smisk boosted performance for some services in 10 multiples, when compared to Twisted.

Smisk is a high-performance web service framework, with its core components written in C, but controlled by Python. Smisk also exposes a MVC-inspired package, adding Transparent Content Negotiation, class tree routing, templating, ORM-support, etc. Read more at the Smisk website.