skip to content

UltraNormal

Importing Your Del.icio.us Tag Cloud In Movable Type

Someone on the Movable Type ProNet list asked how to import their del.icio.us tag cloud into thier blog a couple days ago, and since I'm stuck here on the couch, I'd see if I could figure out an easy way to do it... and you know what, there is!

All you need to install is the very cool MTGetXML plugin, and create yourself a new index template. The important bit to add is this:

<ul class="tags">
<MTGetXML keeproot="0" 
  location="http://USERNAME:PASSWORD@del.icio.us/api/tags/get?" 
  cache="60">
<MTGetXMLElement name="tag">
<li style="font-size:<MTGetXMLValue name="count">em">
  <a href="http://del.icio.us/USERNAME/<MTGetXMLValue name="tag" encode_url="1">" title="<MTGetXMLValue name="count"> links">
      <MTGetXMLValue name="tag">
  </a>
</li>
</MTGetXMLElement>
</ul>

Here's what my CSS looks like to get my tag cloud to look the way it does:

ul.tags {
    list-style:none;
    text-align:justify;
}

ul.tags li {
   display:inline;
   padding:0 .3em;
}

And in case you missed the link earlier, here's what it looks like. Enjoy!

Update: And because I couldn't sleep, I did the same thing with my categories. It was a little more involved (because I have some categories with more than 100 entries in them, I didn't map them right to font sizes, so I had to do MATH!). I kinda like it. It takes some PHP (for the math bits), but it's almost as easy. I'll post my template for it later.

posted October 30, 2005 4:35 AM by Kevin Lawver | | | permalink

Comments:

  • jyoseph said:

    Great implementation!

    When I add this I get an error on rebuild. . . _Parse error in template 'delicious cloud': with no _

    It's looking for an end tag but I see you have one in there, strange huh?

Your Name:
Your E-mail:
Your Site:
Your Comment:

You can use Textile formatting in your comments (but no HTML). Here's a quick cheatsheet: