slayeroffice - web experiments gone horribly awry

09.01.2005 - duplicate filter

Once or twice a week I'll hit and browse through the javascript and dhtml listings to see what the cool kids are up to.

The only problem with this is when something gets particularly popular it shows up over and over again, so a page with ten links may only have three or four links to unique content. That irritates me, so I wrote a favelet to remove the dupes.

I then irritated myself by having to invoke the favelet every time I hit the "earlier" link, and I realized this would be a perfect excuse to check out this Greasemonkey thing I've overheard a couple of people talking about.

After realizing that there was nothing particular in the code that made the extension see a .js file as an installable user script (yes, i freely admit to not noticing it was the naming convention of the file for about 15 minutes) it was an easy transition. So much so that the user script and the favelet are one and the same.

The only difference is that as a user script it runs automatically (obviously), and as a favelet it gives you the option of showing the duplicates it removed. I differentiate between the implementation by checking for the availability of GM_log. If its undefined, its running as a favelet.

As a footnote, I'm certain this has already been written - but, this is the first time in a while I've been inclined to write something even remotely interesting, so I did it anyway :)

You can grab the user script and favelet here. The favelet has been tested and verified to work in MSIE6, Opera 7.5, Firefox and Mozilla. Let me know of any problems or suggestions.

Comments have been closed for this post.