Note

Last.fm API changed and has required API key, so this wouldn’t work with the key, and some links have been removed from this post. (2015-12-14T06:30:48Z)

I have been wondering how I could edit my favorite music section in my Blogger Profile. One good way may be the Last.fm’s top tracks feed.

Note

Since Google+ integration into Blogger, the classic Blogger profile is no more for mine. (2015-12-14T06:28:13Z)

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGkwz43p88mghxeljdxu6I2twxzaCOQ7HDZGS6OU61GwYBpxesPfvPC-O-rklL8aUG1U7sU3iocghCarO4L5a1I9Vpko34RaTHGMlObzs4yGv0ETooZmYGxco9WVbyOjR1_ifyu-FbU3c/s800/toptracks.png

It’s an XML feed (e.g. my overall feed), you need to process it. An easy way is to use XSLT processor, xsltproc, you should be no big deal if you are a Linux user.

1   Linux User (Mac also?)

I have already written a Bash script and a template for use.

Put them together and run the script, you will get something like:

$ ./lastfm-tracks.sh
Your Last.fm username: livibetter

Choose type of your tracks:
 1 - Last 7 Days
 2 - Last 3 Months
 3 - Last 6 Months
 4 - Last 12 Months
 Other - Overall

Select?
--2009-10-24 16:24:37--  http://ws.audioscrobbler.com/2.0/user/livibetter/toptracks.xml
Resolving ws.audioscrobbler.com... 195.24.233.55
Connecting to ws.audioscrobbler.com|195.24.233.55|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/xml]
Saving to: “lastfm-tracks.xml”

    [    <=>                                                                                                                                       ] 37,546      33.3K/s   in 1.1s

2009-10-24 16:24:40 (33.3 KB/s) - “lastfm-tracks.xml” saved [37546]

===== BEGIN =====
Lebe lauter, Fieber, Das Beste, Optimist, Ohne Dich, Meer sein, Misery Business, Nie genug, An Sommertagen, Augenblick am Tag, Mitten unterm Jahr, That's What You Get, Come to your senses, Ich wünsch dir was, Ich Lebe, Anders, Revolution, Stupid for You, Free Loop, Engel fliegen einsam, Spell, Umbrella, Traffic, Orchester in mir, Reine Nebensache, Seite Eins, Nie zu spät, Better Off Alone, Scherbenmeer, Geile Zeit, Warum, Wenn die anderen, Glücklich, Voice on the Radio, Regen und Meer, Nein danke, Dieses Leben, Ich verschwinde, Zu Weit, Sonne hinter dem Nebel, So Wie Jetzt, Das Ende vom Kreis, Say It Again, Unendlich, Unsere besten Tage, Um bei Dir zu sein, In Zeiten wie diesen, November, Unfold, Kurz vor der Sonne
====== END ======

You can also open the result text file lastfm-track-result.txt.

I don’t know if Mac user have xsltproc or not, I believe it has. Mac has no problem with shell script, this should also work.

2   Windows User

Please follow the instructions in Installing an XSLT processor. I didn’t try it.

Once you install it, you should be able to use it. You need to manual download the feed from Last.fm and run this command with the XSLT template alongside:

xsltproc lastfm-tracks.xslt DOWNLOADED_FEED.xml

3   Final Note

If I wrote it in Python, there should not have much problem and could have a GUI, but I don’t think it’s worth. I want to make it fully automatic not just semi-automatic. But I also need Blogger API to support Profile update, unfortunately, it doesn’t support that at this moment. I am not sure if it will in future. I don’t want to trick Blogger, which means simulating your editing in that page.

There is also a other sections like movies and books, but I don’t know any websites provide similar feed as Last.fm do for music.