After a few late nights, I've successfully implemented Easy News Topics (ENT) tags to my Radio Userland RSS feed. It wasn't as easy as I thought it would be. It involved rooting around in the Radio.root file of my weblog and upskilling myself in UserTalk, Radio Userland's scripting language. But mostly I stood on the shoulders of giants to get this done - Dave Winer and Matt Mower in particular.
ENT is an extension of the RSS2.0 spec. Its aim is to enable categorization of RSS items into topics. After reading about ENT and writing one of my first articles about RSS topics, I decided I wanted to actually implement ENT into my weblog. After some initial searching, I came across an article by Dave Winer called "How to extend Radio's RSS generator". This introduced me to 3 new "callbacks" which enable Radio developers to modify their RSS feeds. The callbacks are: writeRssNamespace, writeRssChannelElement, writeRssItemElement. The first one I successfully implemented was the namespace. I did this as follows:
1. Open up your Radio.root file.
2. Drill down to user.radio.callbacks.
3. Double-click on writeRssNamespace, then re-name "item #1" to "ent".
4. Enter the script linked here.
5. Click "Compile".
That was relatively easy. Implementing the item elements turned out to be trickier - particularly as the elements have attributes and are nested. It took me a while to get to grips with the UserTalk syntax, not being a programmer by trade. I bumbled around a bit and got to a stage where I juuuust about had the script right. Then I happened upon Matt Mower's conversation with Dave Winer and finally things fell into place. Here now is my code for the writeRssItemElement script - same process as above.
But wait, there's more. Because the ENT tags are nested, there is one more piece of scripting you need to do - modify writeRssFile. But luckily Matt Mower, one of the authors of ENT, has already done the work - right-click here to download the script. Open this in your Radio app, and it will automatically save itself in the workspace area of Radio.root. Then you need to copy it across to the following location:
btw as a sidenote, writeRssfile is just one of many very clever scripts built-in to Radio. It's amazing how much data there is in Radio.root, once you have a good poke around. It's a testament to the amount of work Dave Winer must have put in to build Radio Userland, so I do sympathise with his recent posts about software developers gettin' paid.
Anyway that's basically it for stage 1 of implementing ENT into my Radio RSS feed. Stage 2 is to actually put some worthwhile data into my topic tags - currently I've just got dummy data in there. Ideally I want to dynamically generate a topic word or phrase for each weblog post, based on the contents of the post and/or the title. But I guess this is where k-collector comes in. So that's my next project, to find out about k-collector and put some meaningful data into my shiny new ENT tags :-)