Greasing the Meerkat

samtregar on 2005-04-15T16:50:12

I while back I wrote about wanting a better use.perl link display in Meerkat. My solution at the time was Middleman, a configurable HTTP proxy. I ended up ditching it after it caused some extremely difficult to debug problems developing a web-app. Instead I created a little chunk of Javascript which accomplished the same thing. I attached it to a link on my tool-bar which I click every time I visit Meerkat. It works, but it's hardly ideal.

Enter Greasemonkey, a plugin for Firefox which allows you to add Javascript to a page based on a URL match. I took the Javascript I already had in my link, converted it to a Greasemonkey user-script and now I see author names in Meerkat without any effort on my part. Fantastic!

For the record, here's my user-script:

// ==UserScript==
// @name          Meerket User Names
// @namespace     http://sam.tregar.com/userscripts
// @include       http://www.oreillynet.com/meerkat/*
// ==/UserScript==

(function() { 
    for (var x = 0; x < document.links.length; x++) { 
        var l = document.links[x]; 
        if (l.href.indexOf('~') != -1) { 
            var name = l.href.substring(l.href.indexOf('~'));
            name = name.substring(1, name.indexOf('/')); 
            l.innerHTML = '[' + name + '] ' + l.innerHTML;
        }
    }
})();

-sam


Immediate Reaction To The Title

chaoticset on 2005-04-15T19:51:17

Ew.