This short block of code will pull your recent tracks, complete with album info from this site, cache it in an XML file on your server, and output the HTML that will display your list. Due to the use of SimpleXML, this is a PHP5+ solution.

You may need to create an xml file on your server and chmod it to 777 so the server can overwrite it. Name the file with your username. For instance, mine is roblogic.xml
<?php
//from marc2003's script on last.fm forum
$user 'your_username'//last.fm username
$limit 5//Number of results to display, 1-10
$cache 120//in seconds, how long to cache data locally
$size 160//Uniform size for album images. Use null for actual size

$remotefile "http://zenradar.roblogic.net/service/1.0/user/$user/recenttracks.xml";
$localfile $user.'.xml';
if ((!
file_exists($localfile)) || (time()-filemtime($localfile)>$cache))
{
    
$contents = @file_get_contents($remotefile);
    
$fp fopen($localfile"w");
    
fwrite($fp$contents);
    
fclose($fp);
}

$limit = ($limit<=10) ? $limit:10;

$xml = @simplexml_load_file($localfile);
for (
$t 0$t $limit$t++)
{
    echo 
"<div><a href='".$xml->track[$t]->album->url."' target='_blank'>";
    echo 
"<img src='".$xml->track[$t]->album->coverart_medium."'";
    echo 
" alt='".$xml->track[$t]->album->name."' width='".$size."' height='".$size."' /></a><br />";
    echo 
"Artist: <a href='".$xml->track[$t]->artist->url."' target='blank'>"
;
   
echo $xml->track[$t]->artist."</a><br />";
    echo 
"Track: <a href='".$xml->track[$t]->url."' target='blank'>"
;
    echo $xml->track[$t]->name."</a><br />";
    echo 
"Album: <a href='".$xml->track[$t]->album->url."' target='blank'>"
;
    echo $xml->track[$t]->album->name."</a></div>";
}

If you are limited to PHP4, click here to download a version that does not rely on SimpleXML. Be sure to change the file extension from .txt to .php.