Ma.gnolia WordPress plugin 0.2

[Edit: The latest version of this plugin can be found here.]

I finally got round to hacking up the Ma.gnolia plugin so that it caches the link list for 30 minutes (by default), so as not to irritate the Ma.gnolia XML server any more than really necessary. Until now, it had been sending a request for each and every page render. I meant to fix it last week, and completely forgot…

To recap, this plugin allows you to easily publish your latest Ma.gnolia links in your WordPress sidebar (or anywhere else you want to call it from).

WordPress’s built-in RSS handlers didn’t seem to like Ma.gnolia’s feeds (they serve them up with a 301 redirect, which Snoopy apparently can’t cope with – details here), so I’ve used PHP5’s built-in DOM XML functions. Obviously this means that you will need version 5 of PHP on your server. If this isn’t an option, feel free to use my original JavaScript plugin, still available here.

The syntax remains the same as the previous version, with the exception that the byline is no longer an option. The default number of links to show is 10.

<?php magnolia(USERNAME[, NUMBER_OF_LINKS); ?>

eg. to show my 10 latest links, I simply use:

<?php magnolia('barryprice'); ?>

To show my 23 latest links, I’d use this instead:

<?php magnolia('barryprice', 23); ?>

Dead simple.

Diffs to automate usage of this plugin with K2 will be up shortly at some point…

Download Ma.gnolia plugin v0.2

Ma.gnolia plugin 0.1

[Edit: The latest version of this plugin can be found here.]

Here’s the latest version of my Ma.gnolia plugin for WordPress. It allows you to publish your latest Ma.gnolia links in your WordPress sidebar (or anywhere else you want to call it from).

WordPress’s built-in RSS handlers didn’t seem to like Ma.gnolia’s feeds, so I’ve used PHP5’s built-in DOM XML functions. Obviously this means that you will need version 5 of PHP on your server. If this isn’t an option, feel free to use my original JavaScript plugin, still available here.

The syntax remains the same as the previous version, with the exception that the byline is no longer an option.

<?php magnolia(USERNAME[, NUMBER_OF_STORIES); ?>

eg. to show my feeds with the default options, I simply use:

<?php magnolia('barryprice'); ?>

To show 23 of my feeds, I’d use this instead:

<?php magnolia('barryprice', 23); ?>

Dead simple.

Diffs to automate usage of this plugin with K2 will be up shortly.

Download Ma.gnolia plugin v0.1

Ma.gnolia WordPress Plugin 0.001

[Edit: The latest version of this plugin can be found here.]

Okay, this is laughably rubbish, but it works. Hopefully publishing this version will motivate me to write a proper one.

This is just a wrapper for Ma.gnolia’s JavaScript feed – I haven’t had time to write the RSS/XML parser yet. I had forgotten how much I hate PHP.

You can set the default number of stories to include, as well as whether to include the byline, within the plugin code itself. Or just override them when you call the function. The defaults number of stories is 10, and the byline display boolean defaults to ‘true’.

Call it from within your sidebar, like this:

<?php magnolia(USERNAME[, NUMBER_OF_STORIES, BYLINE_TRUEORFALSE); ?>

eg. to show my feeds with the default options, I simply use:

<?php magnolia('barryprice'); ?>

To show 20 of my feeds without the byline, I’d use this instead:

<?php magnolia('barryprice', 20, 'false'); ?>

The RSS/XML version of this plugin will be better. Hopefully. Can’t believe nobody else has written one of these yet, looks like you’re stuck with this one for now…

Download ma.gnolia plugin

PS. Regarding K2 integration, I’ve hacked my local version to allow K2 to auto-configure this plugin (as it does by default with Alexander Malov’s del.icio.us plugin). Will send some diffs to Michael if he’s interested – as soon as I’ve finished the final code…

Ma.gnolia

Ma.gnolia, aside from having another of those tiresome Web 2.0 names, is a much prettier and more functional version of del.icio.us. I’ve started using it instead of del.icio.us, and can’t quite believe there isn’t a WordPress plugin, like Alexander Malov’s del.icio.us plugin (in my sidebar). If there really isn’t one, I guess I might have to write it myself…

Anyway, that’s why my linkblog has been so stagnant. The site has been risibly stangnant too, for which I apologise. I’ve been hugely stressed since returning from Thailand, and simply haven’t had the time or inclination to post a single thing. I’ve had several ideas, but insufficient enthusiasm to pursue any of them.

I’m returning to Donegal for a week next month, so there’ll be plenty of photos and writing there I’m sure. After then, who knows?