What is the Son of last.fm

The Son of last.fm is a local server version of the statistical database of last.fm. The statistics are a bit improved as this version is not build to support a huge number of concurrent users.

The Son of last.fm is released under the GPL.

As last.fm, the Son requires a plugin in your media player. The plugin sends info about each song you play to a server where the information is stored in a database. The plugins are just a recompiled version of the plugins used for last.fm. All that is changed so far is the server address. The XMMS plugin is the only one tested with the Son of last.fm.

The Son is not particularly Internet Explorer friendly (before version 7) at the moment, as it uses CSS with "position: fixed". It's not that the Son dislikes IE, it just don't care :-) It can easily be changed to something that don't look this bad in IE, but unfortunatly this also cripples other browsers, at least what I have tried.

The Son of last.fm is released under the GPL. Which more or less means that you can do anything you like with it as long as you give other users the same rights. Please read the license for the details. If you make improvements to the Son of last.fm that may be useful to others, please let me know, even if you are not required to do so. The address is "solfm(at)exponto.com"

Why the Son of last.fm

While last.fm worked mostly very well for the month or so I used it, I became a little hooked on statistics for no rational reason at all. It also was a welcome reason to learn a bit php, which I have neglected so far. And now, if I want some weird statistics, I can just write a little php script and voilą. It had to be a client/server thing, since I have several machines.

What does it do, exactly

The plugin reports, the Son collects and generate statistics on demand. Details? Ok, about half way through (or after some 3-4 minutes) a tagged song the client plugin sends a message with the artist, song title, timestamp (UTC) and a little more. The Son just passes this on to the database, where they will reside forever and forgotten, unless some seeking soul ask the Son to generate a report. Then the Son will happily report tings like last played tracks, most played artists and tracks. The Son can also generate monthly or weekly charts of tracks or artist until the beginning of time, which, in Unix, is in 1970. The Son, however, will not know anything about what you played in 1970. There also is an option to list all tracks by a particular artist.

As the Son supports multiple users, all user must register. There is no secrets here, so if you really like insert artist it may be publicly known. Only way out is to destroy the tags in the music file.

Bits of information that may be relevant for someone: The Son shall be able to handle UTF-8 correctly. All timestamps are treated and displayed like UTC. Currently all data handling is done in the database, php just have to get the selects and the output right. There is an alias table that is used to select and decide the name of an artist. The reason for this is that tags for the same artist may be written in different ways, "lastname, firstname" or "firstname lastname", and also you may (or may not) consider "Frank Zappa" and "Frank Zappa and the mothers of invention" as the same artist. You decide. Unfortunatly there is no webpage for this sort of editing provided yet.

A warning about the Son of last.fm

This is not shrinkwrap software.

An installation requires quite some effort. Before you even start you have to have a database running, a working webserver with support for php and all what is needed in order to compile the last.fm plugin. None of these steps will be explained in detail as this is done better elsewhere.

Here is a link for PostgreSQL. Since version 8 a native Windows version is also available. Apache and PHP is probably easiest to install from your distribution if you use Linux. The available source code for the media player plugin can be found here. Be sure to select the source for your media player and choose the "Audioscrobbler Plugin", not their Radio player.

After these steps you are ready to start the installation and here are the steps you must go through:

  • Setup the database
  • Configure the webserver
  • Copy the webpages so the webserver finds them
  • Modify the web pages, this maybe optional
  • Copy the webpages so the webserver finds them
  • Change the server address in the plugin source and compile it

If you intend to use another database than PostgreSQL, some additional php or stored procedures work have to be done. Still not scared? Hmm, there might be a reason why I'm not into advertising.


  • Add user rating of tracks
  • Playlist generations, need to know where the tracks are located, client modification?
  • CSS and rounded corners
  • Add an easy way to modify the alias table
  • Some more statistics
  • Support more options in the client/server handshake protocol
  • Help Internet Explorer to display the pages in a better way.


  • Help Internet Explorer to display the pages in a better way. A conditional comment hopefully displays the "old" style navbar for IE 6.

Known issues

  • Borked form layout in firefox 1.04 (ok with 1.07) on search artist page -> assume this is a Firefox issue