has announced some new widgets that you can place in your web site. I decided to create a PmWiki recipe for how to embed them there. For an example, notice that my sidebar now has an album quilt. Without further ado:

This recipe allows you to incorporate widgets into your PmWiki installation.

To install, place lastfm.php in your cookbook directory, then add the following to config.php or another local configuration file:


You can embed radio players, playlist players, quilts, or charts.

For more information, see

The recipe enables the (:lastfm:) markup. You add arguments to customize the widget.

Here are the arguments:

  type (chart, radio, playlist, quilt)
  color/colour (red, blue, black, grey)
  chart (recent, topartists, toptracks, weeklyartists, weeklytracks)
  quilt (album, artist)
  orient (horizontal, vertical)
  size (small, medium, large for quilts; regular, mini for radios)
  autostart ( 1 for an autostarting radio )

If you just put in a username and nothing else, you will get, by default, a red medium-sized chart of recent tracks played.

Tags >>

Posted in ,

9 comments on " Widgets for PmWiki"

October 12th, 2007 at 9:01 am

I get some errors with IE7. Did you test it with this browser?

October 12th, 2007 at 8:45 pm

I think so. What kind of errors are you getting? I'll have to try it again, I guess.

October 13th, 2007 at 11:21 am

I checked that the first error was caused by template from skin "not2simple" that I'm using. The other one is from lastfm.php: Syntax error, code 0. When I remove the following line: onclick=" + &squo;&shrink=0&squo;, &squo;lastfm_popup&squo;, &squo;height='.$popupheight.', width='.$width.', location=no, toolbar=no, menubar=no, directories=no, personalbar=no, status=no, resizable=yes, scrollbars=no&squo;); return false;" style="background-image:url('.$args['color'].'.gif);"></a>'; all is ok. Additionally I found that have changed their widget a little - do you know about it?

October 13th, 2007 at 10:13 pm

I hadn't noticed that they'd updated the widgets. I'll see if I can work up a new version that's consistent with whatever changes they've made and maybe that'll take care of the problem.

October 15th, 2007 at 5:36 am

IE doesn't like &squo; I think that you should replace it with '

October 15th, 2007 at 5:38 am

I mean by ascii code: & # 3 9 ;

October 15th, 2007 at 11:44 am

I see--thanks. I don't use IE, so I suppose I wouldn't know about such things. I'll see if I can fix it sometime soon.

August 30th, 2008 at 5:04 pm

This is an interesting cookbook recipe. Unless I"m missing something, however, it seems to miss out on one of lastfm's most remarkable features, which is the ability to create radio streams with music "like" such and such an artist (e.g., like Josquin des Prez). I'm a teacher with an educational wiki and I would love to be able to embed such themed radio in my course wiki. E.g., for a page on the blues, have a stream music "like Charley Patton." I certainly DON'T want my students listening to my own eclectic last fm "user" music. Any suggestions?

Jon (
September 9th, 2008 at 11:09 pm

Yep, that's kind of a problem. I think those sorts of things require you to be a subscriber (am I remembering that correctly?) and thus putting it in widget form is sort of problematic. If they ever do produce a widget though, it would be pretty cool to put it in a recipe like this.

Add a comment

E-mail: (for gravatar only, not stored.)
Website: (e.g.
Type your comment
Type this number: 251