Last.fm Charts

6 July 2008

Album Covers

This is a fun little script I wrote up that reads your weekly top albums chart from Last.fm, gets the cover art for each album, then displays the top albums on your blog. Scroll to the bottom of the page to see how it looks. Yes, there are Wordpress plugins that do this already, but I always think it’s a bit more fun to try to roll my own. Most of other scripts tend to use your recent tracks feed as well, which doesn’t work well for me as I tend to listen through albums so my feed only ever shows a couple of albums. The data I’m using comes from Audioscrobbler’s web services, and there a loads more feeds available for those wanting to customize the script.

The script needs to be included manually in your blog template, so should work fine in any blog software running on a server with php 5 or higher. If you are comfortable with php you should find it easy to customize the output to suit your blog design.

To use, download the script, upload to your server and use include 'path/to/lastfm.php'; to add it to your template. Then you’ll need to create a cache folder somewhere on your server and change it’s permissions to 766. (The script uses some simple caching to avoid over use of the xml feeds, but it should probably be caching the images as well.) Then edit the top of the lastfm.php file to customize your settings. You’ll also need a blank album image to use when something goes wrong.

The script outputs pretty simple html that should be easy enough to style with just css.

There are no comments so far. Comments are open and you can add one here.

Posted under Blogtender, Internet, Music, php.

Leave a comment:




XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Recently

Upgrading to WordPress 2.6
17 July 2008

Blogtender was hacked yesterday, resulting in a handfull of posts getting a list of invisible links added to the bottom, I assume in the hope that Google will pick them up. After changing my passwords (probably unnecessarily) I decided to upgrade to WordPress 2.6. The upgrade process is easy …

Incredibly Strange Film Festival iCalendars
12 July 2008

“I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.”Douglas Adams, Last Chance to See

The Incredibly Strange Film Festival is back …

Last.fm Charts
6 July 2008

This is a fun little script I wrote up that reads your weekly top albums chart from Last.fm, gets the cover art for each album, then displays the top albums on your blog. Scroll to the bottom of the page to see how it looks. …

Sharing a Canon laser printer between OSX and XP
5 January 2008

In case anyone else runs into this problem in the future, here are the steps needed to share a Canon Imageclass 4140 laser printer between OSX and XP. I’ve only tested this under Leopard, but it should work for Tiger as well.

First, the problem. While …

Archives: 2008 2007 2005

Music

Photos