mcw_ma_gnolia

mcw_ma_gnolia is a TextPattern plugin that generates a customizable Ma.gnolia link roll for use on your website. Download it now, and start playing!

Updated 17. June, 2006: Version 0.4 is out, tweaking the plugin to work with Ma.gnolia’s new linkroll JavaScript. This, of course, is a good reason to start working on something that actually uses the Ma.gnolia API instead of parsing through a linkroll JavaScript file. I’ll be starting on that soon.

Updated 26. April, 2006: Version 0.3 is out, adding the ability to filter the links in your linkroll by a specific tag, and changing the link retrieval mechanism so that it functions correctly on more servers.

Updated 25. April, 2006: Version 0.2 is out, and corrects a small bug with the mcw_ma_gnolia_uri tag.

What is it?

Ma.gnolia is a social bookmarking site (somewhat like del.icio.us) that I use to keep track of interesting websites I come across. It provides the built in ability to display your most recent bookmarks on your personal website (a ‘link roll’), but I don’t like the mechanism it uses to make that happen.

Ma.gnolia provides you with a JavaScript file that uses document.write to dump the link roll to your site. This works, but it’s not exactly accessible, nor is it very flexible. mcw_ma_gnolia leverages this built-in mechanism to provide what I hope is an extremely flexible and accessible link roll without the use of client-side JavaScript.

In a nutshell, the plugin downloads and caches the JavaScript file server-side on a quasi-hourly basis, extracts the link information, and makes the data available for you via a series of TextPattern tags that you can use in your forms and pages.

How Do I Use mcw_ma_gnolia? (e.g. quickstart)

Start by downloading the plugin and installing it like you would any other. Once you’ve gotten the plugin installed, edit it, and enter your ma.gnolia username and the number of links you’d like displayed into the public config section of the PHP code (should be lines 6 and 7 or so). If you don’t do this, you’ll be seeing my links. That’s a fine way to test, but you’ll probably want to make this change before you go live.

Next, click on the extensions tab, and then on the Ma.gnolia Linkroll subtab. Hitting this page will automatically create a form called mcw_ma_gnolia, and offer you the opportunity to force-update your cached ma.gnolia links. Go ahead and hit that button now to speed things up later.

Finally, edit a page to include the <txp:mcw_ma_gnolia /> tag. Viola, ma.gnolia links on your page. Astounding!

How do I configure the output?

Excellent question. Here’s brief documentation of each of the tags this plugin enables:

Example page:

Page: default

...
    <div id='ma_gnolia_linkroll'>
        <h2>My Recent Bookmarks</h2>
        <txp:mcw_ma_gnolia
            form='mcw_ma_gnolia'
            wrap_tag='ol'
            class='ma_gnolia_list'
        />
    </div>
...

Example form:

Form: mcw_ma_gnolia

<li>
    <a 
        href='<txp:mcw_ma_gnolia_link />'
        title='<txp:mcw_ma_gnolia_title />'
    ><txp:mcw_ma_gnolia_title /></a> - <txp:mcw_ma_gnolia_desc />
</li>

Would produce:

<div id='ma_gnolia_linkroll'>
    <h2>My Recent Bookmarks</h2>
    <ol class='ma_gnolia_list'>
        <li>
            <a 
                href='LINK_GO_HERE'
                title='TITLE_GO_HERE'
            >TITLE_GO_HERE</a> - DESCRIPTION GO HERE
        </li>
        ...
        <li>
            <a 
                href='LINK_GO_HERE'
                title='TITLE_GO_HERE'
            >TITLE_GO_HERE</a> - DESCRIPTION GO HERE
        </li>
    </ol>
</div>

Nice, eh?