Use Standalone Feedreaders with OmniWeb

I recently wrote a little love letter to my dear friend, OmniWeb, regarding my inability to (easily) subscribe to RSS and ATOM feeds in an external, standalone feedreader (such as Vienna). Sure, OmniGroup have built in a bookmark-based feedreader (of sorts) into OmniWeb. That’s fine for a casual feed user, but my needs are far beyond such a system being practical. Most other Mac browsers respect the system-wide feed default (which you can generally set in the Safari preferences panel, or in many related apps prefs panels), shovelling over the feed URI to your default reader. However, Omni haven’t built this functionality in… yet.

There is hope, though. We’re all familiar with different web protocols, such as http:// and ftp://. Well, there seem to be an increasing number of somewhat pseudo-protocols (they may be legit protocols, I’m no expert on that) that just seem to function in handing off some information from the browser to an external application. If you’ve ever added a plugin to QuickSilver or Adium from the respective websites, you’ve used one of these psuedo-protocols.
Well, one of these protocols happens to be feed://. If you open a feed link in Safari (with Safari as the default feedreader, mind you), you’ll notice feed:// in place of http:// in the location bar.
This got me thinking: does OmniWeb respect this system-wide protocol?

A few seconds of testing later… sure enough, it does. If you enter the address of a feed (for example, http://gregorybowers.com/rss) in the location bar, and replace the http:// with feed:// and hit enter, it will off-load the URI into your default reader.

Ooooooooooo!

Now my brain was really spinning—couldn’t I make a bookmarklet to grab the feed out of the <link> tag in the document head? And then change the http:// to feed:// and have that bit of javascript load the URI and thus send it to my feedreader?

Oh man… this could work… it had to work.

Crap. I’d never written a bookmarklet. I knew there were some limitations and such, but essentially it was just a bookmark with some javascript. After an hour or two of reading up, I decided to do it the old fashioned way: hack up someone else’s code!

I tried various versions and ran into no end of hassles, but then I stumbled across a boss little bookmarklet on HowToCreate.co.uk that scoured the link tags in the head, grabbed the stylesheets, then popped up a window with links to each included sheet (or, if only one file, show that). Genius!

A little bit of unscrambling of the script, and I was able to figure out where I needed to change the code to look for rel="alternate". Clickity click and… crap. Nothing. Tested it in Camino: worked… but that was moot, because this had to work in OmniWeb, or nothing. Then, the realisation of my idiocy—OmniWeb’s popup blocker was stopping the popup. It worked! Huzzah!

Except… these were still http:// links. Clicking them would do the exact same as using the built-in OmniWeb reader. Ass-tastic, Greg. You’ve rebuilt an existing function in a less useful way!

Ah, but javascript can change the content of strings! A tiny bit of code later, and a few updates to the bookmarklet text (don’t want “Stylesheet” emblazoned on the popup), and hello Dolly… we have lift off.

Due to the fact that sites with alternate stylesheets also use a rel="alternate" you may see the odd stylesheet show up in the list. If the site has titled them properly, though, it should be easy to tell which link is a feed and which is not.

So how does it work?

Well, first things first: add the following bookmarklet to your “Favorites” bar in OmniWeb via a simple drag and drop. This bookmarklet should work in other browsers too, if you want to try it. No idea about IE, but Safari and Moz browsers should work.)

Grab Feeds!

Now whenever you are on a site that you’d like to add to your feedreader, just click the bookmarklet:

Click it

If you have popup blocking on (you probably do), you’ll need to jump down to the status bar:

Blocked popup in omniweb

Then click and choose the window we just made:

Chose OmniWeb

Here are our links to the site’s feeds (or if the site only has one feed, the script skips this step). We just click whichever feeds we want to add.

Choose the feeds you want by clicking the links

And OmniWeb throws the URIs over to our feedreader.

Yes! It Worked!

Oh, and you can even try the script if you aren’t sure the page has a feed—if nothing is in the head, it’ll tell you so. Enjoy, and let me know if you have any problems.

This has only been tested on OmniWeb 5.5.1. I’m not positive of how it will work on prior versions… give it a shot and let me know.

Edit [22 Nov 06]: I’d also like to note that I’m using Jon Hicks’ OmniWeb Tiger Theme in the screen shots. It’s lovely.

<

p class=”note” style=”background:#f8feeb;border: 1px solid #b5c19c;padding: 0 10px”>As of version 5.5.2, OmniWeb properly handles system default Feed handling. The bookmarklet is still handy, however, if you wish to subscribe to an embedded ATOM feed, which the built-in feed detection ignores.