This is a PHP class that I put together to assist me in working with the LAST FM api.
It's got three main parts of functionality:
Query LAST FM and find the latest track I listened to This can be passed in any number, so to return any number of latest tracks listened too. Using the track information query and return artist and song information. Query and return my favorite tracks by times listened too.