Audioscrobbler – how to put recent tracks on your blog/site

I use the RSS feed of my recent tracks combined with the free FeedDigest service to show the recent tracks I listened to with AudioScrobbler/last.fm. You can see it in the right-hand column – it’s titled “Recent Tunes”.

Feeddigest does all the work. Sign up for a free FeedDigest account and give it your RSS feed URL (mine is http://ws.audioscrobbler.com/rdf/history/brianpipa)

Use one of their templates or use a custom one – I use this as my template:

<li class="music">
<a href="%URL%">%DESCRIPTION,25%</a>
</li>

so for every entry, it creates it as an li element of class “music”. It will link to the last.fm page for that song, it will use the description as the text on the webpage, and it will cut it off at 25 characters.

Once you create it in feed digest, you click on the “get the code” link and you put the code in your sidebar. Since I am running WordPress, I use the PHP code like this:

<?php
include ("http://app.feeddigest.com/digest3/4J2AUPCK1S.html");
?>

but it also supports including it via Javascript.

(optional) To get the little speaker icon thingies, my stylesheet has a li.music entry in it to put the audio.gif in front of each entry. The stylesheet entry looks like this:

li.music { list-style-image:url(/images/audio.gif);
}

Do NOT use the image straight from my site. Put it on your own site. If you use it directly from my site, I could at any time switch the image to something you may not like.

One other nice feature about FeedDigest is that it caches the RSS. If you go for a while without playing songs it will still show the last data it had…you never get any empty lists on your site.

UPDATE: Just so you know, the most frequent you can set a free Feeddigest to update is every 30 minutes so you only get snapshots of what you are listening to – you don’t get a true running list. If anyone knows of a way to do what Feeddigest does (convert an RSS feed into an HTML list) that does it realtime (doesn’t just cehck it every 30 minutes) – please let me know. I bet there is a PHP script that can do this. An yes, there is a way to do this with an image by using the free service at DenNess and there are some “image-makers” you an run on your own machine too (PHP).


, , , , , ,

11 thoughts on “Audioscrobbler – how to put recent tracks on your blog/site

  1. John Doe Jr

    I have had this for a while, but if you notice, it will not refresh with your 10 most recent tracks in your audioscrobbler feed.

    Sometimes I get 6, 7, 8, 9, but never 10. Change your tagging to show the date / time played, you will see what I mean. The top few will be recent, but the bottom ones will be older stongs from various times earlier in the day.

    RESPONSE: You bring up a good point. The most frequent you can set a free Feeddigest to update is every 30 minutes so you only get snapshots of what you are listening to – you don’t get a running list. –Brian

    Reply
  2. Sam

    This is very informative, and I went to the site you mentioned to get an account, but I couldn’t find where to sign up. Are you familiar with Xanga? If so, do you think Xanga would support this type of thing? Because I would like a self-updating recently played list to show up on my Xanga in a div layer under my profile, like the one you have. I just don’t know where to get the account for FeedDigest. Help with this would be muchly appreciated. (I signed up on the forums thinking it would let me onto the main page, since I saw no sign up page on the main site, but that didn’t work either…)

    RESPONSE: Just put in your feed on the front page – on the next page , you can customize it and sign up for a free account. –Brian

    Reply
  3. Sam

    Meh, of course. Xanga has to be complicated and after all that, they don’t even support any of the coding. Javascript won’t even do the trick there! I should have figured. Thanks for your help anyway. Stupid Xanga…

    Reply
  4. Hawk

    Nice informations… It works a bit. But when I refresh my homepage it doesnt update my newest tracks ive listend to…

    Do you know why this might be?

    RESPONSE: Check the update I just added into the post –Brian

    Reply
  5. Lewcid

    Hey there, just thought I’d let you know that http://www.feedjumbler.com seems to do realtime rss to html conversions. It’s working fine for me but I havent really been able to get it to look all that great, though using a css file has helped. Then again, I’m not using php.

    If you’d like to have a look: http://tinyurl.com/76p9v

    Hope this helps in some way.

    Cheers.

    RESPONSE: The realtime aspect of FeedJumbler is appealing, but the formatting limitations make it unusable for me. It makes each entry as a paragraph. I need it as an HTML list to use it on my webpage.

    Reply
  6. Lewcid

    Yeah, understandable. Best I’ve managed is to get all the entries in one paragraph separated by tags.

    RESPONSE: Well, I got it to look good, but it doesn’t do caching so you can end up with soem times where you have NO songs to display. I’d rather have a non-realtime list that is always there than to have it be realtime but potentially empty at times. –Brian

    Reply
  7. suzuki

    Hello! This blog that it was difficult as for the English for the Japanese who watched blog of English study in various ways now that it came from Japan was interesting

    Reply

Leave a Reply

Your email address will not be published.