Mr. Casals

Probably the worst blog name ever

My First Octopress Plugin: Spotify Play Button

I’m a big fan of Spotify. I use it everyday, I pay my monthly fee to get rid of those annoying ads (I don’t know what ads do people get in other countries, but Spanish ones are really annoying… really). I was really happy when they launched their Metadata API, but today’s announcement is even better.

Embed Spotify everywhere… even Octopress!

Spotify’s new feature Play Button lets you embed a single track, an album or a playlist to any web page, giving you the possibility to put a soundtrack anywhere. So I decided to make an Octopress plugin for this. You can find its source on GitHub.

The plugin is pretty simple. You have to use the spotify liquid tag and, as param, one of the following examples.

In the next release it will let you specify the height and the width of the widget. I hope it won’t take very long :)

A single track

Example input:

1
spotify spotify:track:4vVE8YDntxjT0gld4bdd4x

Example output:

An album

Example input:

1
spotify spotify:album:2B9q4KPjOEYu885Keo9dfX

Example output:

A playlist

Example input:

1
spotify spotify:user:mrc2407:playlist:1O9JUUKiMqA8LXahz61fCH

Example output:

Some independent tracks

Example input:

1
spotify spotify:trackset:PREFEREDTITLE:5Z7ygHQo02SUrFmcgpwsKW,1x6ACsKV4UdWS2FMuPFUiT,4bi73jCM02fMpkI11Lqmfe

Example output:

Comments