How to display title-less feed items

I’ve written previously about why title-less feed items exist. In a nutshell, some posts are so short they don’t have titles. Prime example: Tweets.

Sometime soon the Scripting News feed will have title-less items. If you develop feed reading software and want to offer Scripting News links and posts to your readers, your software must be prepared to handle title-less items.

This piece shows how a feed reader can intelligently handle items with and without titles.

Terminology

For this howto we may need up to four ingredients from a feed item: title, link, description, guid. When displaying the item, we need up to two bits: headline and body. Depending on what’s in the item, the headline might link to something, or just be bare text linking to nothing.

How to

If the item has a title, the headline is the title.

If the item has no title, but has a description, the headline is the first N characters of the description. The value of N is up to you, based on how you lay the items out on a page, or if it’s a river. In this case the body is empty. We’ve already used the description once. This is where a few aggregators repeat the text. There’s no need to do this, it’s unsightly, confusing, and shows lack of care for the reader.

The headline usually links to something. If the item has a link element, the headline links to that. If it has a guid, but no link and the guid is a permalink, the headline links to the guid. If it has no link, no guid, or the guid is not a permalink, then the headline is bare text, it’s not an anchor element.

If the item has no title and no description, it’s not valid RSS — skip it.

Examples

  1. An item with a title, link and description.

  2. An item from a linkblog feed, has no title. The same item in my feed.

  3. How Chrome displays my linkblog feed.

  4. A river that’s made up of feeds with a mixture of titled and title-less items.

RFC

This is the method I’ve used in all my river software going back to 1999. They have all been able to handle title-less items. However, I wrote this howto from memory, not from code, so there might be omissions, mistakes or typos. Corrections are appreciated.

Disclaimer: This isn’t a standards body convening in the comments here. I just wrote a howto to help people out, not to begin a “process” or to debate. The Scripting News comment guidelines apply. Use your own space for essays, posts, opinions, screeds, memes, rants, etc that don’t fit the guidelines. Thanks!

Advertisements

About Dave Winer

Dave Winer, 54, pioneered the development of weblogs, syndication (RSS), podcasting, outlining, and web content management software; former contributing editor at Wired Magazine, research fellow at Harvard Law School, entrepreneur, and investor in web media companies. A native New Yorker, he received a Master's in Computer Science from the University of Wisconsin, a Bachelor's in Mathematics from Tulane University and currently lives in Berkeley, California.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s