Last.fm thing

Warning, this is a pretty “techincal” post, and you should probably only bother reading it if you maintain a website yourself; there’s not really much point otherwise as it won’t be of any relevance.

Now, you may have noticed the thing on the right hand side of the page that seems to just have a load of rotating square pictures

That’s my “Last.fm album quilt”, as they call it, and it shows the latest however many albums that I’ve listened to. That’s because I’ve got a Last.fm account, and an Audioscrobbler plugin for my media player.

Now, you may be thinking “What the hell is this guy on about?” and I don’t blame you. However, let me explain. Audioscrobbler, the plugin for my media player (there’s a plugin for pretty much any media player for your computer) submits what track I’m listening to to my Last.fm account. This then records and displays it for all to see, so people with similar music tastes can get in contact with me, or the site can recommend similar artists and albums, etc.

Now, another service they offer are these “widget” things, which are basically things like the “Album quilt” you can see on the right hand side. This takes the data from my Last.fm profile and displays it in a nice pictorial form, for display on a blog or website, like I have.

The trouble is, if you’re a bit of a tech geek like I am, you’ll notice that the code that they give you when you go to get one of these widgets is very messy and is invalid in XHTML. And this is where I come to the rescue.

If you sign up for a Last.fm account (and I advise you do; let me know if you do as well), and maintain a website or blog (possibly an unlikely combination), then I advise you not to use the rubbish code for the artist quilt that they supply, and instead use this:


<div id=”lastfmthing”>
<object type=”application/x-shockwave-flash” width=”185″ height=”291″ id=”penguin” data=”http://panther1.last.fm/widgets/quilt/11.swf”>
<param name=”movie” value=”http://panther1.last.fm/widgets/quilt/11.swf” />
<param name=”quality” value=”high” />
<param name=”allowscriptaccess” value=”samedomain” />
<param name=”flashvars” value=”type=user&variable=YOURLASTFMUSERNAMEHERE&file=topalbums&bgcolor=blue&theme=blue&lang=en” />
</object>
</div>

Now, if that previous bit meant nothing to you, worry not, just copy and paste it where you want the Album quilt to appear instead of the code that they give you, and you’ll be fine. The reason I’m doing this is that the code that they give you is invalid. The code I just gave you conforms to XHTML 1.0 standards, and so is much better 😉

If this whole post meant nothing to you, I’m sorry, I just felt like posting something technical (well, this is my only blog; I can’t only post stuff about Ewing’s Sarcoma, can I? ;-)).