IMS_Blog

Because I forget stuff. Part of norcimo.com

Note: It appears you must have reached this page by a deep level URL. In general this site is currently down and unmaintained. See here

About This Post

Originally posted December 21 2005 at 22:12 under Blogging and Web. 0 Comments. 1 Trackback (now closed). Last modified: 24 March 2006 at 01:01

Not Tagged Test

Mood:
Hacked
Location:
Gateshead

So what’s with all the testing I hear you cry (what, nobody’s reading this? Don’t be silly). Well, Technorati just introduced some new features. The bit particularly relevant here is point number 4 on that list—enhance profiles, particularly that tag cloud (Aside: the link David Sifry gives to his own profile in that post is wrong. He’s missed the d off the start of the username—he’s dsifry not sifry). Aha, I thought. Somebody else can do all this tag work.

Tags

Personally I’ve never really got this whole folksonomy idea. I think my mind works too much on a constricted categorisation and search mentality. I’m happy to put things into more than one category but not the overwhelming number of tags I could possibly think of adding. I don’t see the point. With bookmarks, for example, I’ll might put the same bookmark into one or two folders but if I actually can’t remember which folder it’s in I’d rather search than try and work out a useful tag to look under. Publically shared tags (del.icio.us, Flickr for the big two examples) seem even less use. My idea of what something should be tagged is unlikely to match somebody elses. I’ve never found something I’m looking for using tags. I’ve come across a few interesting and potentially useful sites by browsing through tags of interest but even then there’s an awful lot of crud to wade through to get to those one or two sites. Maybe this random browsing is really the point, more than search and find, and I’m just missing it. I suspect it really is more the way my brain is wired though.

Tags are seemingly the “in thing” at the moment though—the new way of forming the interlinked, interconnected, hyperdriven semantic web, or something. Personally I don’t see it going that way. I’m not a doom merchant who will declare the death of folksononies (is that the correct plural?); they’ll stick around. I just don’t see them as being the huge be all and end all some would have us believe. They’ll continue to pop up all over the place, including some completely silly places, until sense returns and they die down to live in the places they are actually of use (whatever places they may be). After all, isn’t a list of tags just keywords exposed? Meta data writ large. And meta data is of use for the machines, not the humans, to sift through.

Tagging These Posts

Having said all that these posts are now tagged. It’s something that I’ve never done before mainly because I didn’t really like the overhead for something I wouldn’t particularly use. Technorati have essentially given me a way to off load the overhead of keeping track of tags however. The new profiles include a tag cloud just for that user. And there’s a way to link to those tags, just for that user, too. So that’s what I’m doing. Of course, it wasn’t quite that simple, hence all the testing.

The first thing that anyone paying attention to where the tag links are pointing will see they are aimed squarely at this blog still, in the form blog/tag/foo There are a couple of reasons for this. First the link to the Technorati tag for a user is http://www.technorati.com/tag/foo?user=bar which as far as I could tell is a form you can’t use as a tag for Technorati to recognise (I could be wrong on this—I didn’t test too hard because of the next point. If I’m right it would be nice if they would recognise that sort of thing still). Secondly pointing to my own blog gives forwards compatibility in case I decide to implement some more advanced tagging system at some point—all the links go to a sensible place. Hitting one of the links actually just encounters an Apache mod_rewrite rule which sends the browser off to Technorati (it would have been nice to do this using RedirectMatch, which is what I tried first, but I couldn’t get it to give a me an unencoded ? in the redirect URI). For the record, the following is the addition to the .htaccess file in the top level directory of norcimo.com

RewriteEngine on
RewriteRule blog/tag/(.*) http://www.technorati.com/tag/$1?user=norcimo

Producing the tags

This blog runs on MoveableType. There are a number of plugins which give tagging capabilities, some more complex than others. None of them does quite what I want though. I don’t want a whole database of tagging information, or pages (or a category!) for each tag. The closest available would be to output the post’s keywords as tags. That’s was an option with the advantage that it would mean previous posts would get tags, and the keywords ought to be relevant but I wanted more fine grained control of that. I use keywords as, well, keyword meta data. Machine data. The keywords on posts don’t quite have the feel of human readable tags. So I wanted a way to generate tags from some mystical place that didn’t use the keywords. Fortunately I already had one in the KeyValues plugin. I’ve already been using that to supply the location, mood and music information for each post, so it’s easy enough to use for tags as well. The only problem is that outputing the key value would only give a list of whatever I put in, which meant either putting in markup for each tag when tagging a post (very tedious) or finding a solution. Brad Choate supplies the solution to that problem too, with the amazingly useful regex plugin which, as the name suggests, allows you to perform regular expression search and replace. The tags are output as an unordered list (which is then styled so it doesn’t look like one) so we can use the following regex substitution (if you’re a regex expert be gentle—I find them incredibly useful but I’m not too good at writing them) applied to the MTKeyValue output s/\b(\w+)\b/<li><a href="http:\/\/www.norcimo.com\/blog\/tag\/$1" rel="tag">$1<\/a><\/li>

Edit: Changed the regex to allow things like lost+found to be a single tag. It now reads s/\b([a-zA-z0-9+]+)\b/<li><a href="http:\/\/www.norcimo.com\/blog\/tag\/$1" rel="tag">$1<\/a><\/li>

Anyway, the outcome of all this hackery is that tags now appear on posts. So there you go.

Update: Hmm, it seems that if the list of posts under a tag for a particular user runs to more than one page, the next page link points to the second page for that tag overall rather than just for that user (i.e. it’s pointing to …/tag/foo?start=20 rather than …/tag/foo?start=20%user=bar) I’ve just sent feedback pointing out that minor quirk

Addition: I realised I included bits of the code making this work but I may as well include the template code in full, just in case. So the snippet of MoveableType template code (requires the aforementioned plugins). Note that the tags are set using tags=tag1 tag2 in the extended entry field

<MTAddRegex name="tagslinker">s/\b(\w+)\b/<li><a href="http:\/\/www.norcimo.com\/blog\/tag\/$1" rel="tag">$1<\/a><\/li>/g</MTAddRegex>
<MTAddRegex name="tagslinker">s/\b([a-zA-Z0-9+]+)\b/<li><a href="http:\/\/www.norcimo.com\/blog\/tag\/$1" rel="tag">$1<\/a><\/li>/g</MTAddRegex>
<MTKeyValues>$
<MTIfKeyExists key="tags">
<ul class="taglist"> <li>Tags:</li>
<MTRegex pattern="tagslinker">
<MTKeyValue key="tags">
</MTRegex>
</ul>
</MTIfKeyExists>
</MTKeyValues>

Comments (0):

Post a comment

Name and email address are required. Email address is never shown. If you enter a URL your name will be linked to it (this and other links will have the rel attribute set to contain nofollow). Markup allowed: <a href="" title="" rel=""> <em> <strong> <abbr title=""> <acronym title=""> <p> <br />. Anything else is stripped; please be valid. Single linebreaks automatically convert to <br />, double to <p>'s. Additionally anything that looks like a bare URL should get automagically linked. Many acronyms and abbreviations are also automagically handled.

Please note this blog's comment policy

Trackbacks (1):

Whisky Helps

What the bloody hell's going on with all these title="A Previous Blog Post">dum de dum posts? That was me playing around, trying to get something to work. I think I have now. If you'd really like to know what (it... [Read More]

Tracked from IMS_Blog on Dec 18, 2006 at 13:42

Trackback URL: http://www.norcimo.com/MT/mt-tb.cgi/307

Advanced...

This Crazy Fool

Who:
Dr Ian Scott
Where:
Croydon (and Gateshead), United Kingdom
Contact:
ian@norcimo.com
What:
Bullding Services Engineer (EngDesign), PhD in Physics (University of York), football fanatic (Newcastle United), open source enthusiast (mainly Mozilla)

More about me [Disclaimer]

You may subscribe to IMS_Blog using the RSS Feed, the Atom Feed or by email.

Creative Commons License

© Ian Scott. Powered by Movable Type 3.2. This blog uses valid XHTML 1.0 Strict and valid CSS. All times are local UK time. For further details see the IMS_Blog about page.. All my feeds in one.