Weblog
Reach out and make it.
Tinderbox Export: RSS 2.0 and Atom 0.3
4/9/05 22:48 - email - category: Tinderbox

I use Tinderbox from Eastgate Software for all kinds of grooviness, including the creation of 2Second(fuse). When I began building this weblog the existing feed templates just weren't rocking NetNewsWire the way I wanted them to. A bit of reverse engineering, occasional glances at the specs and a little perseverance gave me new export templates for both RSS 2.0 and Atom 0.3. This wasn't difficult to accomplish, but did take some tweaking before the new feeds would validate.

If you're a new Tinderblogger (or one without feeds) and export your weblog to your own site rather than using Blogger or MovableType, this may save you some work.

Set Up

There are four HTML export template files you'll need to place in your local html templates directory:

rssnews.txt, rssnewsitem.txt, atomnews.txt, atomnewsitem.txt

They're available in two versions:

tinderfeeds_24.zip for use in Tinderbox 2.4

tinderfeeds_25.zip for use in Tinderbox 2.5.

Download them, then fire up a text editor and have a look. You'll want to edit them to include your own copyright info, author name and email address in the appropriate spots. Make sure you have the attributes set in your Tinderbox document for WeblogTitle, WeblogTagline and base URL, as this data is used in the templates.

Step By Step

First, I created two agents which skim the first few posts from a container called archives, one for RSS and one for ATOM.

Outline view in Tinderbox 2.4 showing RSS and Atom agents collecting recent posts for the feeds.

The container archives is kept sorted chronologically, most recent first, so the Agent Query below gathers the most recent entries into RSS and ATOM. You reach this query pane by selecting each agent and hitting Enter. Each agent is the same here except for its Name. I chose to feed only the nine most recent entries, but it could be any number you like. After an entry is no longer within range, it will drop out of your feeds.

Agent query settings for RSS agent.

If you don't keep your entries in a main container called archives, just substitute the name of whatever container you're pulling from.

Next, select each agent and hit Cmd-Option-I to bring up Info. To set the proper HTML export values double-click the attribute properties for each of the following:

HTMLExportTemplate for RSS == rssnews.txt, for ATOM == atomnews.txt

HTMLExportFileName for RSS == index, for ATOM == atom

HTMLExportExtension is .xml for both agents

Below are my complete HTML export settings for the RSS agent. The ATOM agent is exactly the same with the above exceptions.

RSS agent complete HTML export values.

How It Works

The main template files (rssnews.txt and atomnews.txt) wrap header and closing information around the exported feed page, and tell Tinderbox to process each child note inside the agents with a second template before inserting its data in the main feed.

This second template (rssnewsitem.txt and atomnewsitem.txt) simply formats each note to be an individual entry in the feed.

Cleaning Up

Export your weblog to HTML (Cmd-Shift-H) and presto! The feed files you've generated (index.xml and atom.xml) should go in the top level of your website, the same directory where index.html lives.

Put the following discovery code inside the <head></head> tags of your site's index.html page:

<link rel="alternate" type="application/rss+xml" title="YOUR_WEBLOG RSS 2.0" href="http://YOUR_SITE_URL/index.xml">

<link rel="alternate" type="application/atom+xml" title="YOUR_WEBLOG Atom 0.3" href="http://YOUR_SITE_URL/atom.xml">

I've tested the feeds generated by these templates using NetNewsWire and Pheeder on OSX, FeedReader on WinXP and Firefox's built-in feed reader on both platforms. The RSS feed has also been routed through LiveJournal's built in feed support and shows properly on Friends pages. (Thank you, Mgoa Bloom.)

Looking around at other people's feeds for examples to crib from, I found most feeds have at least a few problems and won't validate. These feeds will. You can test them out (or 2Sec's own) at feedvalidator.org.

Happy syndication!


the weblog of Vlad Spears
Chief Iconoclast - Daevlmakr Media
Designing Monsters - vitruvius.livejournal.com

recent
Cycling '74 Loves Cats
Seemingly Solid Things - Glenn Gibson @ GIVEN
drmArm
Life In 3d
It's Full Of Stars
Retracted Landing Gear

category
2Second(fuse) 7
Action 1
Atmos 3
Biome 1
BlueDeceiver 2
Creation 6
Daevlmakr 12
Exorcism 16
Flow 10
Futurism 15
Gear 19
Idea 4
Image 3
Incantation 19
Knowledge 5
Listen 18
LiveMusic 3
Locate 2
Look 3
MaxMSPJitter 16
Politics 16
Quote 1
Read 10
Science 2
SoundDesign 4
Technology 3
Tinderbox 5
Unfälle 2
Vegetarian 3
Vision 2







legalese
All written material on 2Second(fuse)
authored by Vlad Spears is published under the
Creative Commons Some Rights Reserved license



Attribution - NonCommercial - NoDerivs 2.0

Fight corporate ownership of culture:
Create and Disseminate!