Graham King

Solvitas perambulum

Sage – the graham patch

sage software
Summary
I recently started using Sage as my feed reader, a handy Firefox plugin that I wanted to enhance with a few features. I developed a patch for the latest version from CVS, which adds an unread item count by feed name, a configurable timeout for requests, and the post creator's name in the feed item list, particularly useful for group blogs. You can apply the patch from the _src/_ directory or install the full extension directly. Note that Sage 1.4 may overwrite custom feed titles if the update option is enabled. The patch works in multiple languages, and I'm open to further translations. For those interested in the technical details, I added methods to manage the unread item count and store preferences for persistent data. Enjoy!

I’ve started using Sage as my feed reader. It’s a very nice Firefox plugin, but was missing a few things I wanted. Coincidentally I’d been wanting to learn more about Firefox plugins, and I had a free weekend (update: more like a few weeks!)…

Here is a patch to apply to the most recent version of Sage from CVS, as of this post. This patch should be applied from within src/. This patch adds:

  • A count of unread items by the feed name, with a setting to turn it on / off.
  • A timeout on the request of each thread. This defaults to 5 seconds and is configurable via the settings screen.
  • The name of the creator of each post, if there is one, in the feed item list box (bottom of sidebar). This is particularly useful for group blogs.

Or install the full extension directly (save the file locally, then File/Open it). Note that this is the latest version from CVS, not the released version, so you’re on your own if it goes wrong (it’s the version I use all the time, so hopefully it’ll be fine!).

Note that Sage 1.4 doesn’t currently respect the preference not to automatically update feed titles. If you use custom feed titles this will overwrite them.

Update: The patch and full version should work in English, French, German, Spanish and Japanese. Further translations welcome.

If you install it, your sage will look like this:

Sage - unread count - screenshot

More technical details on the patch follow…

I added a couple of methods to commonfunc.js, one to get the unread item count for a feed, another to update it. The update method gets called from updatechecker.js when the feeds are updated, and from various parts of sage.js when one or more items are marked as read / unread.

I had originally wanted to put the getUnreadItemCount and updateUnreadItemCount methods in sageFeed.js, but this is only accessible via the idl, and I could not figure out how to pass the resource (lastResource) into the idl.

I save the number of updated items as a preference, because I couldn’t think of another easy way to store persistent data.

I hope you like the patch.