Shorten up those XML posts!

With any luck, this item (in any XML aggregator) will contain just the first sentence – all other content will be included on the weblog itself (for those reading in an aggregator, follow the link to the full post for more info). The advantage to this is that anyone subscribing to my blog will see less content in the aggregator – making it easier to scan headlines and then link to my site if they want the full text.

I accomplished this by following this item at Scripting News, which led me to Jon Udell’s weblog post containing instructions. Like Jon, I’d noticed some sites (Ben Sullivan’s TechBlog in particular) that shortened the XML entries in the aggregator – making it much easier to browse. (By contrast, Doc Searls’ XML entries are challenging, to say the least, to read in the aggregator.)

Do this at your peril: I recommend backing up your Radio.root file before proceeding. And if you’re not using Radio, none of this will make any sense.

Here’s something that makes Jon’s process a bit easier: The item in question is in system.verbs.builtins. radio.weblog.writeRssFile. (In the Radio console, click on “Window | Radio.root” then navigate to the writeRssFile entry. Double-clicking on that will open a new window, which will give you the entire writeRssFile script.)

You’re looking for an item that’s located here:

– on WriteRssFile
– bundle //build xmltext
    – bundle //add the items
         – for i = sizeof (adrblog^.posts[i]
              – if flinclude
                   – bundle //add description, either from the cache, or by recalcing

Below that entry, you’ll find the item that Jon mentions. You need to delete the item that starts add (””… and then paste in the text listed at Jon’s post.

NOTE: This code could easily be over-written by Userland at somepoint. My guess, however, is that they may make this a preference setting in the future (Dave seemed pretty intrigued by the idea).

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.