Go to last.fm and make an account.
Install the scrobbler on your computer, and log into it.
That's it for the capturing part. For the website stuff, you have to go to the last.fm site and request a programmer's API. Go here. Click on Apply for an API account. Log in. Fill out the form, say you're using it for your website. Eventually you will get an "API Key" and a "secret". Record both of these. You will use the API Key to program your info into the website later.
Once you have your programmer's API key, you can make the website say what you're listening to by embedding some PHP codes into your page. I won't go into the details of that here, but here's an example of the PHP code that makes it display what I am listening to right now:
<?php $doc = new DOMDocument(); $doc->load( 'http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=dobrovik&api_key=df9c08c525890635ba274444afc62156' ); $current_song = $doc->getElementsByTagName( "name" ); $song = $current_song->item(0)->nodeValue; echo "<b>Mike is currently listening to $song</b>"; ?>If I put that code into this page, I get this: Mike is currently listening to Chimeras
And that's about it.
It would be really easy to do this in Javascript, and then you wouldn't have to use PHP on the server side...