Categories

Last.fm for WordPress

I know the plugin show a nasty error with WordPress 2.8, I am on it, but seems a internal bug (with the HTTP REQUEST API). I have open a bug in the trac system, and I hope to solve this issue soon. Thanks for your patience…
The bug has been solved! You can wait to the next WordPress upgrade or download the modded http.php file into your wp-includes directory)

Last.fm for WordPress displays your Last.fm recently listened tracks in your WordPress blog.

Features

  • Simply
  • Customizable
  • Widget ready
  • No options page (yes, it’s a feature)
  • Uses WordPress resources (no extra files needed)
  • Multiple widgets (Thanks to Michael Feichtinger)

Installation

Drop the lastfm-for-wordpress folder into /wp-content/plugins/ and activate the plug in.

Usage

If you use WordPress widgets, just drag the widget into your sidebar and configure.
If widgets aren’t your thing, use the following code to display your recently listened tracks:

lastfm_tracks('username');

Last.fm for WordPress also has several configurable options. Here’s what you can configure:

lastfm_tracks('username', [tracks], [list], [timestamp], [linked], [encode_utf8]);
  • username: your Last.fm username
  • tracks: number of recently listened tracks to show
  • list: show tracks in a unordered list
  • timestamp: show a relative timestamp
  • linked: create a link to each track
  • encode_utf8:turn it on if you have encoding problems

Only username is required. The other parameters will take this default values:

lastfm_tracks('username', 5, true, true, true, false);

This is: 5 tracks, in a list, with timestamps and with links.

So, if I wanted to show my last 5 recently listened tracks, not in a list, with timestamps and with links I would use the following:

lastfm_tracks('username', 5, false, true, true);

Customization

The plug in provides the following CSS classes:

  • ul.lastfm: the main ul (if list is activated)
  • li.lastfm-item: the ul items (if list is activated)
  • p.lastfm-track: each one of the paragraphs (if tracks > 1)
  • .lastfm-timestamp: the timestamp span class
  • a.lastfm-link: the track link class (if linked is activated)

Live Demo

lastfm_tracks('Ryck');

Download

Version History

1.3.1 – 2008/04/17

  • Fixed: Invalid HTML with titles with special characters. Thanks aljuk

1.3 – 2008/04/08

  • Now using human_time_diff() instead own function: better performance, less code and automagically i18n!

1.2.1 – 2008/04/1

  • I messed it up with the encoding. Now works.

1.2 – 2008/03/31

  • Added encode_utf8 option in order to (hopefully) fix the encoding issues.

1.1.1 – 2008/02/26

  • Small bug fixed. Thanks to Mateus Moraes

1.1 – 2008/01/03

1.0.1 – 2007/09/08

  • Fixed some HTML encoding issues. Props to Dave.

1.0 – 2007/08/22

  • Initial Release

Credits

Contact

Suggestion, fixes, rants, congratulations, gifts et al to rick[at]jinlabs.com or by my contact page.

Code

Maybe you could be interested in my other plugins: Code

70 replies on “Last.fm for WordPress”

[…] vind je een Last.FM widget. Hoewel, widget, het is wat gepruts in html/css in combinatie met de Last FM plugin voor WordPress.  Nu kunnen ook mijn messenger buddies zien welke tunes er door de boxen knallen.  […]

[…] Descobri ontem. Você cria um perfil como no Orkut, mas ao invés de ficar catando pessoas, você procura por músicas. Pode ouvir de tudo. E também conhecer pessoas de todo mundo. Pode conhecer os álbuns dos artistas do mundo inteiro. Adicionar músicas ao seu perfil e assim ir construindo sua própria rádio on-line. Ver os video clips das músicas, sem precisar ficar procurando no Youtube.com ou outro. Veja que em minha barra lateral estou exibindo as músicas que ouço no meu WinAmp, e na ordem que estou ouvindo. Também é um recurso da LastFM.com associado ao plugin Last.fm for WordPress. […]

[…] Last.fm – this gives a list of all the Last.fm songs that I’ve scrobbled in the recent past, i like to know what people are listening to, and i’d like to think that other people like to know what i’m listening to.  I think it’s a fun way to share interests and often says a lot about a person (in my eyes at least!) […]

[…] uses last.fm’s monitoring of my winamp playing stuff. after that, i’ve installed a widget that spares me the trouble of a flash(y) embedded last.fm thingy. just plain text, with no links […]

[…] Gone are the Last.fm flash widget – in it’s place, a simple text-based list courtesy of the Last.fm for WordPress widget/plugin. Also gone is the FriendFeed widget/plugin that didn’t really display anything new but […]