Monthly Archives: June 2002

Programming Jabber review

Cool, my book gets a nice review over at IBM DeveloperWorks.

It’s been about a year now since I originally started researching and writing it; I’d taken a few months off work to devote time to it. It sure was a fun, but intense, time. I can appreciate much more now just how much work goes into writing a technical title, and I re-read books on my bookshelves with awe anew.

Accessibility and Blosxom

Catching up with things today, I read what Mark‘s been doing on the accessibility front. A great job it is too. I thought I might contribute a tiny bit of the jigsaw for the Blosxom users, specifically regarding the meaningful page titles and additional navigation aids.

I’ve updated my weblog in these two areas; each specific page – be it a year, or a year/month, or a year/month/day specification, now includes the appropriate date in the page title. I’ve added a <link rel=”home” … > link too, which I’d thought fleetingly about when I was looking at other attributes of the <link/> tag but had forgotten until being reminded by Mark.

To achieve this sort of thing, you can just add the extra bits in the head.html template. I’ve taken Blosxom’s default/builtin head template (which is inside Blosxom itself) and amended it appropriately – you can have see what it looks like here – to use it, just place the file in same directory that you keep your .txt files.

In actual fact, I use Blosxom more of an engine that generates the blog postings for me, which I then include, via SSI, in a template that holds together lots of elements, such as the calendar, and the various lists. So I don’t use the head.html template file. Instead, I wrote a tiny script, blostitle, which outputs the appropriate date string for appending to the title. I include the <link rel=”home” … > link manually in the SSI. Altogether, the <head/> part looks like this:

<head>
...
<title>
DJ's Weblog
-
<!--#include virtual="/~dj/cgi-bin/blostitle" -->
</title>
<!--#include file="style.incl" -->
<link rel="home" title="Home" href="/qmacro" />
...
</head>

A change and a rest

Just returned from a very relaxing holiday; we stayed at the Saunton Sands Hotel in Devon. Great place, wonderful views, and good service. We spent most of the time flying kites on the huge beach – fantastic. Looks like lots of things have been going on, yahoo!

‘Blosmail’ – add and maintain your blog entries via email

I’ve just put together a little script, blosmail, that lets you add (and modify) your Blosxom-powered weblog entries via email. The idea is that you can send emails to yourself with a specifically recognisable Subject: line, and via some procmail recipe magic, and a check on whether the sending email address is listed as valid, lo and behold, new blosxom blog entries appear in your weblog.

Here are the details of how it works and how to set it up.

Standing on the shoulders … Exploring Weblog Neighbourhoods with Blogdex

Inspired by Mark, and Dave, I’ve been doing a bit of neighbourhood exploration hacking of my own.

Last week, I was alerted to Blogdex by Ben (through the funny little Metalinker Javascript-induced ‘[b]‘ links on his RSS weblog pages). It’s an interesting project that trawls weblogs and compiles link information (I don’t know how wide it trawls, so your URL might not be in there. YMMV).

I though I’d write a script to use Blogdex’s information and perhaps complement Mark‘s blogrollfinder.py script and Dave‘s weblogNeighborhood tool. My script, bdexp, compiles a ‘neighbourhood’ view of a weblog URL by following the ‘links to’ information for that URL in Blogdex. (This is the ‘browseSource’ Blogdex URL). You give it a weblog URL, and an optional depth (how far to descend, default 2 levels, maximum 4), and it goes away, pulls and analyses the information, and gives you a rank list of results. I’ve weighted the scores – the further ‘down’ a URL appears, the fewer points it gets.

I’ve “CGI’d” (ugh) my script so you can have a go too. Call it like this: http://www.pipetree.com/~dj/cgi-bin/bdexp?url=http://www.pipetree.com/qmacro/ and have patience while the script descends Blogdex information and does its stuff. I’ve deliberately slowed the script down so it doesn’t hammer Blogdex’s servers. In fact, results are cached too, for added politeness :->

But wait – there’s more! So that the information made available through this script might be used to correlate, augment, and otherwise confuse neighbourhood information determined from other sources and methods like Mark’s and Dave’s, you can get XML output, rather than HTML. Just add &xml=1 to the URL like this: http://www.pipetree.com/~dj/cgi-bin/bdexp?url=http://www.pipetree.com/qmacro/&xml=1 and you’ll get a very simple XML format containing the same data. This makes it dead easy to just pull in this Blogdex-powered neighbourhood information into your own tool. Well, that’s the theory anyway :-) (You can specify the depth with &depth=N too).

I’ve implemented a little lock mechanism so that only N users can use the script at once; I’m not sure how my server (it’s only a poor old Celeron), or Blogdex, will take to massive parallelism. Ok, this is wishful thinking, of course … hardly anyone reads this anyway… ;-)

Thank you Cameron at Blogdex for compiling this linking info.

Usual disclaimer applies – my code is just hacked together.

Small Blagg mod to enable custom formatting of ‘blaggregated’ items

Well, further to the little formatting blaggplug I wrote yesterday to reformat the blaggregated items for my Morning Reading, I decided to go a step further and add a tiny template mechanism to Blagg so that this sort of formatting change could be done in-the-style-of Blosxom, that is, by allowing Blagg to format the items as before, or overriding that format using an HTML file in my Blosxom blog directory.

So in the same way that Blosxom users can tune the format of the stories by maintaining a story.html file in their blog directory, now I can tune the format of items that Blagg spits out, by maintaining a blaggitem.html file in the same directory.

Of course, this is an unofficial mod to Blagg, but if you’re interested, it’s here, and for those with a ‘diff’ bent, the differences to the original 0+4i version are highlighted here (the diff also highlights the passing of the extra $i_fn parm in the call to blaggplug::post(), as well as config variable changes peculiar to me).

Changed link tags

Following Dan Brickley’s point about the RSS <link/> mime-type, and Ben‘s and Mark‘s notes, I’ve made the required changes to the attribute contents for the pointer to this weblog’s RSS feed.

Furthermore, regarding the other <link/> tag I have in this document, pointing to the RSS feed list (for which I’d specified a rel value of “feeds“), I’ve had a quick shufty at the allowed values for the rel attribute of the <link/> tag. While “feeds” isn’t explicitly there, and “help” is the closest fit from the choices given, I’ve nevertheless decided to keep the link type “feeds“, and qualify that definition with a meta data profile. Just to see where this leads.

This is what I interpreted from the W3C HTML specs:

  1. There is a provision, following the definition of the explicitly allowed values, to define new link types for the rel attribute:

    “Authors may wish to define additional link types not described in this specification. If they do so, they should use a profile to cite the conventions used to define the link types.”

  2. You can do this by providing the location a meta data profile in a profile attribute of the HTML document’s <head/> tag.
  3. According to the explanation of the meta data profiles, these locations are URIs, which can be globally unique names, or actual links to be followed.
  4. Unfortunately, the specification doesn’t go so far as to actually define what the format of such a meta data profile is:

    “This specification does not define formats for profiles.”

    (If anyone can show me a pointer to where profile formats are described, that would be great!)

  5. So I’ve decided to go for a simple URI, “qmacro:weblog”, for now, on the basis of this statement:

    “User agents may be able to recognize the name (without actually retrieving the profile) and perform some activity based on known conventions for that profile.”

    This is what it now looks like:

    <head profile="qmacro:weblog">
    ...
    <link rel="feeds" type="application/rss+xml" title="RSS feeds"
    href="http://www.pipetree.com/~dj/rss.rss" />
    ...

I might be barking totally up the wrong tree, but that’s the price of fun experimentation. I think the only thing that needs to be different is the actual URI – if we can agree on a standard global name, so much the better.

Collapse/Expand feature for my Blaggregated display

Marc Barrot’s weblog, ‘slam’, has some great collapse/expand features for the display of his items. I’ve adopted his idea, using his javascript, to make the display of my “Morning Reading” neater and more manageable. Thanks Marc! I created a very simple plugin for Blagg to format the titles of the items slightly differently (now they contain the source feed’s title in the item title, so I can see in the collapsed mode where each item is sourced).

HTML link tag for Blogroll

Mark is doing some very interesting social network scripting with a script that recursively follows and compiles bloggers’ blogrolls. It occurred to me, in the context of the RSS autodiscovery flurry earlier this week, to give such scripts a leg-up. Why not use a(nother) HTML <link/> tag to point to a blogroll?

So, alongside the <link/> tag I mentioned yesterday, I’ve added a further <link/> tag thus:


<link rel="feeds" type="text/xml"
      title="XML" href="http://www.pipetree.com/~dj/rss.rss" />

It points to the RSS file of RSS feeds I talked about yesterday, and point to with the [meta] link in the My Feeds list on the right.

This sort of thing should make scripts like Mark’s blogrollfinder.py a lot simpler, if we can somehow standardise this too.