Mike West — Web Application Developer

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?

Mike West is a web application developer living in Munich, Germany. Professionally programming for the web since 2000, he's available for contract work now a web developer at Yahoo! Germany. Read Mike's bio, or drop him an e-mail.

Recent Articles


Comments

Nice work Mike! Can we link to this from our add-ons page?

Posted By: Todd Sieling 24. April 2006, 23:55

Todd,

Absolutely. :)

-Mike

Posted By: Mike West 25. April 2006, 19:10

Any plans to use the new ma.gnolia api in the plugin?

Posted By: Josh 12. May 2006, 16:15

Josh,

I’m thinking about it, actually. Are there any bits in particular you’d like to see added?

-Mike

Posted By: Mike West 12. May 2006, 18:05

I’ve checked out the results of the api requests (namely the bookmarks_find method) and there’s a lot of information that ma.gnolia returns. Personally I’d like to be able to output just a link-list, however, the fact that screenshots are provided as well as the description and tons of other info, in the form of an XML file provides limitless possibilities.

Jeff Croft has done some interesting things with Django and ma.gnolia, but I think he’s grabbing the ma.gnolia output and sticking it in a database before formatting it. A simple unordered list or definition list would be useful. Perhaps it could be fine tuned using attributes in the plugin tag. I don’t know exactly. I’m not that great with PHP and parsing XML. Anyhow, I hope that’s helpful

-Josh

Posted By: Josh 12. May 2006, 20:22

Hey this is a great idea for a plugin, is there anyway to get it to run in ‘safe mode’ though on a server?

Posted By: Jeff 4. September 2006, 18:50

Is there any progress on the development on the plugin using the Ma.gnolia API?

Posted By: Whick 12. November 2006, 00:50

Comments Closed

Comments are closed after 6 weeks to avoid the icky comment spam we all loathe. Sorry if you missed the opportunity, but you can always drop me an e-mail!

flickr Photostream

Yahoo!'s Munich Office
atom:title
atom:title
atom:title