The Lair

Do not meddle in the affairs of dragons, for you are crunchy and taste good with ketchup

kottu.org greasemonkeyed

This is a Greasemonkey script I started writing a couple of weeks ago. I had a specific set of needs from a site I visit on occasion and it seemed like a Greasemonkey script would be the easiest way to accomplish what I needed. It also helped alleviate the boredom of some tedious quarterly report writing. Yeah, and some of the JavaScript used in the script will be reused for another (work) project.

All of these are poorly disguised justifications after the fact, but what does the script do? Well, when I do visit kottu.org, I do so for a specific reason – to be entertained by the aggregated blogs on show. I don’t need the Flickr streams; and I consider the blogroll and much of the sidebar redundant. In most cases, I also don’t need to read the short excerpt. Scan the headlines, in and out. But the existing layout didn’t let me do this easily.


So I figured – I need the summaries collapsed and out of the way unless I specifically ask for them. The + sign on the extreme right of each blog entry is the expander/collapser toggle. Click on that to view the excerpt. I don’t need the Flickr stream, I don’t need the blogroll. The search boxes, excess icons and upcoming links can also be hidden. So, I was left with a far more minimalistic page. A bit of striping to differentiate one entry from another wouldn’t hurt.

The next technical issue was to keep track of who was displayed on the page. Thus, the new sidebar – with the blog URLs and number of entries on the page within brackets. The icon next to the number is a toggle – click on it once and the reddish icon turns to green, and the blog entries are hidden. Click on it again and the entries by that blogger can be revealed once again. Occasionally, someone adds about 4-5 entries to the page – so clearing the clutter is easier if all the entries by a specific blog can be hidden. The end result is shown below.

The more observant among you would have noticed that the second screenshot is of the Opera browser and not of Firefox. Thanks to Opera 9 support for XPath, this Greasemonkey script will run exactly the same on Firefox 1.5 and Opera 9.

So, download kottu.user.js. Incidentally, this script should never make any external requests to a remote server (mine or anyone elses), all the new icons are included within the Greasemonkey script itself.

Props to Dive into Greasemonkey, as usual. I stole or adapted most of the code from the samples in there. Enjoy your kottu – now with fewer veggies and more meat.

Update:: I’ve gotten a number of requests/queries about this so let me spell out my view regards modifications. Quite simple, really: I don’t care. If you want to hack up the script, change it around, change the colours, do whatever – more power to you. Provided you do not (a) pass off the unmodified script as your own work (b) make any malicious changes and redistribute; you can hereby consider the modifications sanctioned by yours truly. I probably don’t have time to give Greasemonkey tutorials to anyone, but if you have any questions, I’d be more than happy to answer what I can as well. The script as it is reflects what works for me – if anyone else has a different idea about how they want kottu.org to look, you’re more than welcome to use this script as a starting point :) I hope that answers all the questions.

“kottu.org greasemonkeyed” has 2 comments

  1. Gravatar

    Grease Kottu at Mahangu.org wrote:

    [...] My buddy tinster has gone ahead and written a neat greasemonkey extension that takes Kottu and strips it down. That’s right, you can now have bitesize Kottu, twice as fast. What’s more, it’s released under GPL. Does it work? Yeah, totally – I’m using it right now. [...]

  2. Gravatar

    The Lair » more foxy tunes wrote:

    [...] Speaking of Greasemonkey, I’m wondering if I need to update a script I did some time ago to account for the new changes to theme and so on. I rarely use the GM script these days because I rarely visit the site; but prod me into revamping it if you feel the need. [...]

Just say it

*Required
*Required (This site supports gravatars)