Swarm.fm's Red-Hot Spotify App: Powered By The Echo Nest

Peter Watts, winner of The Echo Nest’s Social Music App Challenge and Music Apps Hack Weekend, has been building incredible stuff using The Echo Nest APIs for quite some time. Now, he and Swarm.fm co-founder Andrew Dever have gone pro, so to speak, with the Swarm.fm Spotify app, launched today.

Any of Spotify’s 15 million-plus users can install the Swarm.fm app in their desktop clients with a single click from the Spotify App Finder. Once they do, they’ll enter a rich musical universe of social music that lets them do things they’ve never been able to do before, all in the same place: listen to all what all their friends have been listening to on any Facebook-Connected music service, and turn just about anything they see in the app – tags, friends, artists, years, and more – into a streaming radio station that understands their musical taste, in addition to being able to play it all on-demand. (More details and a demo video are available here.)

Yes, Swarm.fm analyzes what’s in your Spotify playlists, your local music library, your listening history, and your own Facebook music behavior to filter what all of your friends have been listening to so that it makes sense for you, personally. The magic behind this feature is our groundbreaking Taste Profile technology, which builds a unique understanding of anyone’s music taste and lets developers apply it to any set of music.

We expect big things from Taste Profiles, and Swarm.fm is one of them. In addition to our Taste Profile API, the new Swarm.fm Spotify app taps into our playlist technology to build a mix around any tag within the app, and our artist data to build the rich artist pages in the app for every artist.

This could be a game-changer, and our technology is at its core. You can try it for yourself here.

What's Google Chrome?

So it turns out that beyond the San Francisco tech scene, not everyone uses Chrome (or even knows what it is). It’s turning out to be a thorn in my side. I’ve been pitching it so often that I’m starting to think Google should be paying me to do this. I dare say a decent chunk of people have starting using Chrome just to try cool extensions like ex.fm. I know I did.


I’m starting this post at 5:59pm EDT (7:59am my time). Which means I made it. A kick-ass music app in 20 days. Here she is: http://bit.ly/qc54Hx

And now to bed.

Go. No go.

So after racing frantically to finish today, The Echo Nest have announced that they’re postponing the deadline for the contest for a month. To be honest, I’m a little disappointed. I was in crazy hackathon mode, locked in my room, writing all sorts of code that should never see the light of day. Now I have time to do things like go outside. And eat.

But regardless of this development, I’m sticking to my guns. A kick-ass music app in 20 days. At some point before 6pm EDT (probably a few minutes before), I’ll be unveiling the latest version of Swarm.fm and +Music. I’ll chuck it up on hacker news, tweet it to Techcrunch and just sit back and relax. That’s how it works right?

Go forth and share

Wouldn’t it be cool if you could share what you were listening to with friends, and they could actually listen to the track without leaving their news feed. Yes, yes it would. And that’s what I added today. The player now features more details about the track you’re listening to

and if you hit share, you can recommend the track to friends

add a message if you want and the track gets posted to your wall

it is now fully streamable, even for friends without the app

Note that none of this requires you to authenticate an app. This is because I create an Open Graph page for every track and use standard ‘Like’ buttons for sharing. At the moment these pages look pretty bland

so i’ll need to tidy them up before release (in approx 30 hours). should be beautiful by this time tomorrow!

Playin' it safe

My original plan was to build a music hub (swarm.fm), that turned your Facebook friends and their ‘Likes’ into a fully streamable music collection. Part of this experience would be a chrome extension, that provided the music playback, and went with you anywhere on the web. That extension, now known as +Music, evolved to become far bigger (and cooler) than I imagined. So with two days left in the race to build a kick-ass music app, do I rush to build swarm.fm with limited features, or do I make +Music the focus and polish it up for submission?

Last night I played around with some of the features for Swarm, and came to the conclusion that two days simply isn’t enough. I still plan to build it, no doubt, but for the purpose of this contest, I’m just going to make sure that +Music is rock solid.

Here’s what’s in the pipeline:

 - Improved Rdio search results
 - Scanning large bodies of text (ie the whole page) and mixing the artists found
 - Auto complete artist names
 - Keyboard shortcuts
 - Tidy up presentation / landing pages
 - Attribution and click-though to the blogs where MP3s are sourced
 - Artist details / links to profiles
 - Share / Send tracks from the extension
 - Better caching / scale-proofing
 - Release in the Chrome Extension Gallery 

As you’ll probably agree, there’s some important tasks in there! So in mourning the short-term loss of Swarm, we can celebrate that +Music is going to really kick ass.

Also, I took some of the testing I did for Swarm around scanning friends and their likes and build a little demo. It literally dumps everything on one page (friends in blue, bands in red). Obviously you wouldn’t do this in a real app (there’s over 5000 images on the page!), but it goes to show the depth of music connections available. If only there was a way to listen to all these bands!

If you want, you can see the page for yourself here. Be warned, it WILL take forever to load / may crash your browser. And apologies to my friends for broadcasting your music tastes. That’s what you get for adding me!


I’ve put out the latest version of +Music for Google Chrome. More details at http://swarm.fm/+music/

Note to self: test on Windows BEFORE releasing :)

Crunch Time

I had hoped to release another beta of the extension today, but alas, I was thwarted by various bugs and hurdles. I will say though, it’s almost there and looking mighty fine. Here’s a look at the new composer, which now let’s you post an mp3, rdio stream or youtube video to your Facebook Wall.

Spam Alert

I hit a brick wall trying to post mp3’s to a Facebook wall, but it looks like I finally made it through. And just in time. I was making so many posts on my test account that Facebook started showing me Captchas. Take a look at the post below and try to tell me this is spam:

Last.fm Scrobbling

I just realised that the +Music chrome extension will scrobble, and I didn’t have to write a single line of code! Rdio keeps track of songs you listen to via the API, and seeing as I have my Last.fm account connected, it scrobbles automatically. Too easy!


I’ve picked a name for the chrome extension. It will be called ’+Music’. And here’s the logo I’ll be starting with: 

Obviously it bears some similarity to Google’s latest offering, but that’s not why it was named. It fits perfectly with the spirit of the app, which is ‘adding music to the websites you visit’. So instead of Facebook, you have Facebook + Music. Or Pitchfork + Music. You get the idea.

I also realise that there may be some confusion around apps and extensions and various names, so let me set it straight. I am building two related products:

swarm.fm: a hub for listening to music that you and your friends like (which I still haven’t started!)

+Music: a chrome extension for adding music to the websites you visit

They will be heavily integrated and use much of the same technology, which I why I consider them to be a single 'app’. But who knows, this could change based on the feedback I get (and if I manage to build swarm.fm in time!)

Day Something

This blog has gone quiet for a few days, but I’ve still been tinkering away on the app. Arriving in Australia, it was clear that the first thing I needed to do was add mp3 playback. Up until this point, all music was played via Rdio, a streaming service which isn’t available here. It still works through my paid account, but for everyone else, the app is useless.

This job was made a little easier by the awesome SoundManager package. It lets you play audio through a simple API, rather than messing around with Flash / HTML5 Audio. I would unreservedly recommend it for any web project involving audio. But there’s was still plenty to do. I had to write a decent amount of code in order to turn it into a fully functional player with an interactive playlist and user controls. The was also some work around offering the ability to seamlessly switch between Mp3s and Rdio, but I got there eventually.

The end result is that you can now use the extension anywhere in the world, using mp3s for playback. The songs come from music blogs across the web and are cataloged / made available thanks to The Echo Nest. The results are often quite different to what is returned by Rdio, and between the two, you’ll usually be able to find good music by any band you’re looking for. There’s still some issues in regards to dead mp3s, but I should be able to get around this by checking files in advance for popular bands. 

Another feature which I added is the ability to play a band via the context menu. Simply highlight their name, right-click and choose Play Mix. This will work on ANY page and will play either mp3s or Rdio tracks, depending on which mode you’re in. This literally took 10 minutes to implement, because all the playback code was already written, but I daresay it will be one of the most popular features in the extension.

The plan is to release another beta tomorrow. This will be a fairly close-to-finished version.

(By ‘finished’, I merely mean the functionality that will exist on Aug 20 when the competition ends. There will be plenty more to come after that date)

Day 13

The whole tracking of ‘days’ is a about to get all out of whack. In an hour I’ll board a flight from San Francisco to Sydney that lasts 14 physical hours, but sets me back 32 calendar hours. 'Kick ass music app in 19.5 days’ just didn’t have the same ring to it. I plan to do some UI design on the plane, though to be honest, even the best laid plans of transit productivity tend to fall to pieces. 

Thankfully, I’ve never been greatly affected by jetlag, so the show should be back on the road in no time. Spending most of your time locked up in unnaturally lit rooms at unorthodox hours has its occasional perks it would seem. 

Day 12

It’s easy to take for granted how powerful the Facebook message composer is. Paste a link and it automatically finds a photo and description. Add a youtube video and BAM it’s embedded. But beneath this beautifully simple UI is a mean, complex beast.

What looks like a simple input field is actually a series of layered elements and hidden fields. And everything is controlled by custom events, making it super hard for a humble chrome extension to modify the behaviour. I’ll spare you the details of my various pitfalls, but let’s just say that a seemingly simple task ballooned to many hours, such that I find myself writing the post for ‘Day 12’ at 7am the next morning (sleep pending).

At least the arduous battle has made the victory all the more sweeter. My code is ugly and could break at any moment, but low and behold, I’ve conquered the Facebook message composer! Here’s what I added:

On your Facebook home page, where you typically post a message, there’s an extra link called 'Music’. By clicking this link you can search for artists, albums or tracks to share with friends.

After searching, you’ll get a list of results from Rdio, Blogs (via EchoNest) and Youtube, which you can attach to your message.

Now just add a comment and it will post streamable music to your feed for all to enjoy!

Day 10

Yikes. It’s already halfway through this crazy adventure. After a flying start, things have slowed down a little. The time-sink that is life and a little too much experimentation has put a strain on the deadline. To make matters worse, I fly to Sydney in 3 days and it wouldn’t be a departure without a fitting send-off, so that’s at least two more days down the drain. I’m at that joyous stage where I’m frantically cutting features from the ideal in pursuit of the realistic. But don’t worry, it’s still gonna kick ass!

Search 'n' Share

In order to build ‘Like’ buttons that will share Rich content, I need to dynamically create Open Graph objects for each album and track (see the last post for more details). And seeing as I had the technology built, I figured I might as well turn it into a search engine! If you’ve ever wanted to send someone an entire streamable album within Facebook, go here and try it out:


Notice how I am using the word 'Recommend’ instead of 'Like’. I think it makes a lot more sense when sharing objects such as albums and tracks.

App Publishing vs Open Graph Liking

As you may have read, I spent yesterday embedding music into Facebook feeds. This was done through an application that had permission to post on behalf of the user. But today I took a different route. When a user ‘Likes’ a page, Facebook scrapes that page to work out what sort of content it is. Through the Open Graph Protocol, you can tell it to embed rich media, such as an MP3 or Flash Player, giving you the exact same capability as if you published through an app.

Why might you want to do this? A few reasons:

1) No authentication required. The user can hit 'Like’ on an album page and instantly that album is embedded in their feed, with needing to give an app permission.

2) Not all apps are created equal. For good reason, Facebook is suspicious of apps that post to users’ walls. It is heavily limited and multiple posts will be hidden if done within a short period. On the other hand, Likes are not subject to the same scrutiny. Far more people responded to my test posts today, whereas yesterday they went by silently. Facebook decides what is and isn’t important and I daresay they rank Likes above Application Posts (I plan to test this).

3) Private Messaging. While an application could let users send music to each other by posting on their walls, Facebook’s new 'Send’ button is far superior. Not only does it work out of the box, it also sends the messages (with embedded content) to the User’s Inbox, letting them have a private conversation around it.

However, it isn’t all good news. This method is harder to track metrics and you don’t get the same links back to your app. So I’m still deciding the best way to go about it. Here is a private conversation between George Harrison and myself ;)


Facebook Graph API

(warning: technical rant ahead)

I have mixed feelings towards Facebook’s API. On one hand, you get in-depth data and powerful publishing capability, but on the other hand, it can buggy, poorly documented and lacking support. It can also be totally inexplicable, which is what I discovered today.

For those who don’t know, Facebook’s new API is called the Graph API. And while some elements are cool, it’s also incomplete, forcing you to fall back to the Old API. Facebook discourages this, but it seems like they might actually the Old API themselves. You see, in order to publish a flash video, you need to pass the flash file (‘source’) and a preview image ('picture’). If you’re missing the picture, it throws an error. But interestingly, the error states that you are missing the 'imgsrc’ attribute, which is what 'picture’ used to be called. It is as if the shiny new Graph API is simply being passed through the Old API! Weird.

Another anomaly I discovered today was around posting MP3s. According to the documentation, you need to set the media type to 'music’ in order for it work. But it doesn’t. Instead, you need to change it to 'mp3’ and it magically works! Anyone making an app that publishes MP3s might want to remember this.

Anyway, I’m not complaining. The API did everything I hoped it would so I’m pretty stoked. Looking for to putting it into action!