Blosxom, Clicktrack and RSS

Today I patched my version of the clicktrack blosxom plugin to fix a minor irritation. After I put in the plugin, I got all the crap, including the lengthened URLs and the flyover JavaScript in my RSS feed. It really isn’t appropriate there, so I patched clicktrack as so (updated again 7/30, after moving the grep to the start function, so it only gets called once instead of every single story ):

First, Up in the configuration section I added this array:

@skip_flavours = ('rss', 'xml', 'rss20');

Then, I altered the story and start functions so:

Add this to the bottom of start:

    if (grep {$_ eq mt}  @skip_flavours) {
          = 1;

and add this to the top of story:

    if () {

which is to say, I added in the check for whether the flavour equals any string from the @skip_flavours and if so it leaves without doing anything. Add this in and away you go, cleaner RSS. Tomorrow I’ll e-mail Nelson Minar and see if he is interested in rolling this into the main release. And, while I’m doing all this stuff and his comments talk about setting cookies to opt-out of the clicktracking, I might as well build this in now. Once you’ve added in the variable, the rest is just new ways to set it to true.