March 20, 2006

Sage – the graham patch

Posted in sage, Software at 00:03 by graham

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.

6 Comments »

  1. Bender said,

    January 31, 2007 at 10:14

    I’d rather use the Wizz RSS News Reader plug-in for Firefox. It is far more powerful and feature rich than Sage.

  2. Bender said,

    January 8, 2007 at 17:05

    The Wizz RSS News Reader for Firefox is actually a MUCH better feed reading option. It is far richer than Sage, offering many features and options. Like the ability to automatically check feeds for new content, the ability to hide items that have already been read, the ability to filter feeds, etc., etc., etc.

    Try it, I’m sure you’ll agree.

    https://addons.mozilla.org/firefox/424/

  3. Matthew said,

    May 25, 2006 at 05:06

    Very nice update. One thing is that the post count doesn’t seem to change when using “mark all as read” only if you mark them individually as read. Also I was unable to make the post count ever read 0. even after marking the last post as read.

  4. Mike said,

    May 16, 2006 at 15:31

    After installing this patch I’ve noticed the Feedburner Search bar doesn’t work (at least not for me).

    I enter a search term and hit enter (nothing). I click on the arrow to the right of the search (nothing).

    Other than that, it works fine for me and solves the problem I was having with the nightly builds in that custom css weren’t working for me.

    I’m using Firefox 15.03.

  5. Patrick Binksma said,

    April 19, 2006 at 19:34

    Hi,

    I installed your patched version of sage. But I got some errors because the translations of the new features (timeout and read/unread) are missing. I patched the german locale and now everything works like a charme;) It would be nice if you updated the xpi with my changed “sage.dtd”.

    Thanks Patrick

    [graham] Thanks for the translation. I’ve included it in the .xpi and patch.


  6. Lenko said,

    April 16, 2006 at 01:30

    I’ve installed the full xpi in Firefox 1.5.0.2 and I’ve obtained an error when I’ve opened the Sage window.

    XML read error: no defined entity Local: chrome://sage/content/sage.xul Line numbrr 123, pos 6: ----------------------------------------^

    (I’ve translated the error message from spanish)

    [graham] Thanks for the translation. I’ve included your translation, so the patch and full xpi should now work in Spanish.

Leave a Comment

Note: Your comment will only appear on the site once I approve it manually. This can take a day or two. Thanks for taking the time to comment.