Subscribing To hAtom Feeds With NetNewsWire

As I see it, the big “wins” for microformats are the ability to take a convention for tag and class usage and layer it over markup that you’re already using in a document to add additional functionality or more specific meaning to the content without adding bloat or working with embedding content that isn’t (X)HTML.

I’ve mentioned hAtom a few times, and I’ve mentioned implementing it on ChunkySoup.net—but in doing that I was left with the feeling that it was quite geeky, but needed some way to leverage that information ow that it was there. Tails is a great plugin for Firefox for picking up data contained in hCards, hCalendar events and a few other data items, but consuming hAtom documents still isn’t easy for the average person. So those wins by following the conventions laid out weren’t yet realized.

Thinking it was time for a solution I turned to NetNewsWire (the /only/ feed reader for OS X), its support since version 2.0 for subscribing to scripts and started hacking on a few shell scripts and AppleScript files looking for a way to make subscribing to pages with hAtom feeds easy. What I’ve come up with is an AppleScript document that’s just been posted for distribution:

Download Subscribe To hAtom v0.2

Installing

Installing the script is as simple as downloading the zip file and putting the documents in the right spot.

  1. Have NetNewsWire 2.x already installed.
  2. Download Subscribe To hAtom in a zip file
  3. Open the zip file to extract the following 3 files: Subscribe To hAtom.scpt, hAtom2Atom.xsl & uri.xsl
  4. Move or copy all 3 files to the NNW script folder at ~/Library/Application Support/NetNewsWire/Scripts/

The script is now “installed”.

Subscribing

Subscribing to a web page with this script is similar to subscribing to any other feed, though you’ll have to enter some additional info in the Show Info window.

  1. Instead of the typical menu or toolbar item to subscribe to a feed use the New Special Subscription menu to make a new Script subscription. File Menu:New Special Subscription...:Script...
  2. You’ll presented with a Finder window that will as you to choose what script, pick “Subscribe To hAtom@. Finder Window: Subscribe To hAtom
  3. Then you’ll be shown a standard Info panel, you may have to expand some of the sections to enter the data but the 3 important pieces of information you’ll need to check before pressing Run Script or closing the dialog are: Show Info Dialog
    1. General – Name: Name the feed
    2. Script Settings – Path: This should already be filled out with the path to to the script
    3. Script Settings – Ards: Puth the URL of the web page you’re subscribing to here
  4. You’re now subscribed to the page as you would any other feed and you should see some fresh items in your subscription window. NetNewsWire window with new subscription

Updates

For updates to the Subscribe To hAtom AppleScript watch this blog. The XSLT document the script uses to parse the documents is developed independently and is called hAtom2Atom. Just download the new version and replace the old file with it.

Some examples of pages on ChunkySoup.net that can now be subscribed to with this script that otherwise don’t have more conventional RSS or Atom feeds:

And of course, though it is a bit redundant, you can subscribe to the front page and get something similar that you get by subscribing to the existing feeds.

Some other sites implementing hAtom can be found in the microformats.org wiki.

The script in its current form is fairly simplistic and just passes the selected web page through xsltproc as is. It does the job, at least as a proof of concept. Look for later version to be a bit more robust, using Tidy if available on the system so it can handle more html pages and doing a better job of communicating errors to NetNewsWire (if I can pick up enough AppleScript to do what I’d like).

Give it a try and let me know if there’s anything else you’d like to see it do.

Comments Temporarily(?) Removed