Nb. Comments on this should probably be directed to the audvidsyn Yahoo group mediarss Yahoo group. Track/pingbacks from the blogosphere are of course encouraged.
There has been some discussion on multiple enclosures in RSS. Dave Winer has clarified that RSS 2.0 only supports one enclsoure per item, something that in my opinion makes RSS 2.0 unfit for blog entries. The talk on multiple enclosures has been very focused on audio and video media, and that's being too narrow. The discussion needs to be opened up, enclosures are much much more than putting talkshows on your iPod.
The current enclosure element in RSS 2.0 is good because it makes no assumption on what kind of file it's linking to. This is a limit regarding including media specific metadata, but what you lose in that department you more than make up for in versatility. Below it'll describe my proposal for an enclosure extension to RSS 2.0. Below I'll describe the proposal, and give a handful of examples of possible uses (just to show how cool and easy this is). Comments are of course very welcome — implementations moreso!
This is an extension to RSS 2.0 in response to the lack of support for multiple enclosures in the original RSS 2.0 specification. The goal is to incorporate the following into RSS:
enclosure element and childrenThe containing element an enclosure is enclosure and it goes inside the item in the feed. Each item may contain any number of enclosure elements. Each enclosure represents an “enclosure” — either a single file attached to the item or several files that should be regarded as multiple versions of the same content attached to the item.
The enclosure element can have one optional attribute (title, as defined below), and can contain any number of link elements. Each link represents an actual file. Thus an item with one enclosure which only exist in one version would be represented by one enclosure element with one link element as a child. The link element has three required attributes, and one optional:
enclosure element.An example of an enclosure, available in one version will look like this:
<enclosure title="An image" xmlns="http://www.solitude.dk/syndication/enclosures/">
<link type="image/jpg" length="200" url="http://www.domain.com/image.jpg" />
</enclosure>
It makes no sense to have multiple versions of the recipient has no way of making a choice as to what version is most appropriate. Each of the attributes (apart from the url) gives you an opportunity for choice.
By looking at the type you will be able to find the type of media/content that best suits your situation. This can be as simple as setting up your aggregator to prefer Quicktime over Windows Media videos, but it can also be used to choose between a spreadsheet from Excel and a SVG graph representing the same numbers. The length could be used to determine quality within the same type. Eg. if two files within the same enclosure has identical type attributes, the file with the longer length could designate the file of the highest quality.
As a last resort the title can be used to determine which version is the most appropriate. The drawback of course being that it is not possible for machines to do much automatic sorting based on the title (since the value is arbitrary). Humans will be able to make choices based on the title just fine though.
I have created some examples to demonstrate the versatility of this simple approach to enclosures. I'll go through the examples below, but if you prefer I have also collected them in an RSS file.
This is a simple photoblog entry. It contains a single photo as the enclosure. It requires more markup than the standard RSS enclosure, but that's the price to pay for the added possibilities.
<enclosure title="My pretty photo" xmlns="http://www.solitude.dk/syndication/enclosures/">
<link type="image/jpg" length="52200" url="http://www.domain.com/photo.jpg" />
</enclosure>
Some times I mess up, and a part of every good call for help is additional information. In this case the problem is described in the standard description element, and attached are two files: An error log (a text file) and a screenshot of the problem.
<enclosure title="Error log" xmlns="http://www.solitude.dk/syndication/enclosures/">
<link type="text/plain" length="100" url="http://www.domain.com/error.txt" />
</enclosure>
<enclosure title="Screenshot of the error" xmlns="http://www.solitude.dk/syndication/enclosures/">
<link type="image/png" length="100" url="http://www.domain.com/screenshot.png" />
</enclosure>
Rocketboom is a videoblog. They post one video per day, but this video is available in three versions (Quicktime, Windows Media and BitTorrent).
<enclosure title="Rocketboom: Casual Friday" xmlns="http://www.solitude.dk/syndication/enclosures/">
<link type="video/quicktime" length="100" url="http://www.rocketboom.com/rb_05_feb_04.mov" />
<link type="video/x-ms-wmv" length="100" url="http://www.rocketboom.com/video/rb_05_feb_04.wmv" />
<link type="application/x-bittorrent" length="100" url="http://www.rocketboom.com/rb_05_feb_04.mov.torrent" />
</enclosure>
In some cases it might be nice to distribute thumbnails along with the full sized images in a photoblog. This is a representation of a photoblog entry containing three photos (a series). A thumbnail of each photo is included.
<enclosure title="Photo in a series" xmlns="http://www.solitude.dk/syndication/enclosures/">
<link type="image/jpg" length="52200" url="http://www.domain.com/photo1.jpg" />
<link type="image/jpg" length="1100" url="http://www.domain.com/photo1_small.jpg" title="Thumbnail" />
</enclosure>
<enclosure title="Another photo" xmlns="http://www.solitude.dk/syndication/enclosures/">
<link type="image/jpg" length="52200" url="http://www.domain.com/photo2.jpg" />
<link type="image/jpg" length="1100" url="http://www.domain.com/photo2_small.jpg" title="Thumbnail" />
</enclosure>
<enclosure title="Ane one more photo" xmlns="http://www.solitude.dk/syndication/enclosures/">
<link type="image/jpg" length="52200" url="http://www.domain.com/photo2.jpg" />
<link type="image/jpg" length="1100" url="http://www.domain.com/photo2_small.jpg" title="Thumbnail" />
</enclosure>
If we look away from blogs, and back to the roots of RSS (newspaper syndication) the connection to using RSS to send out press releases is easy to make. It certainly makes for an easy way for a company to make things easier for the media who would like to reuse parts of the press release. The text of the press release goes in the usual description element, enclosed here are three items. A set of numbers telling how much money the company made, some headshots of a company bigwig, and the company logo. The last numbers (in the shape of a graph), and the logo are supplied both in versions for online use (PNG images) and for print (EPS files).
<enclosure title="Important company numbers" xmlns="http://www.solitude.dk/syndication/enclosures/">
<link type="application/x-excel" length="100" url="http://www.company.com/spreadsheet.xls" />
<link type="image/png" length="100" url="http://www.company.com/spreadsheet-graph.png" />
<link type="image/eps" length="100" url="http://www.company.com/spreadsheet-illustration.eps" />
</enclosure>
<enclosure title="Headshots of company bigwig" xmlns="http://www.solitude.dk/syndication/enclosures/">
<link type="image/jpg" length="100" url="http://www.company.com/headshot1.jpg" />
<link type="image/jpg" length="100" url="http://www.company.com/headshot2.jpg" />
<link type="image/jpg" length="100" url="http://www.company.com/headshot3.jpg" />
</enclosure>
<enclosure title="Company logo" xmlns="http://www.solitude.dk/syndication/enclosures/">
<link type="image/png" length="100" url="http://www.company.com/logo.png" />
<link type="image/eps" length="100" url="http://www.company.com/logo.eps" />
</enclosure>
With enclosures it's possible to use RSS to do software updates by having the software pull down the RSS feed. With multiple enclosures, and multiple versions this becomes easier to manage. Here two files are distributed for a fictive anti-virus program. First a patch is available in two versions depending on the user's current version, and then a virus definition update is included (common for all versions of the anti-virus program).
<enclosure title="Software patch" xmlns="http://www.solitude.dk/syndication/enclosures/">
<link type="application/octet-stream" length="100" url="http://www.domain.com/patch.exe"
title="Patch for software versions less than 2.0" />
<link type="application/octet-stream" length="100" url="http://www.domain.com/patch_20.exe"
title="Patch for software versions above 2.0" />
</enclosure>
<enclosure title="Virus definitions" xmlns="http://www.solitude.dk/syndication/enclosures/">
<link type="text/plain" length="100" url="http://www.domain.com/definitions.txt" />
</enclosure>
Webjay is an online playlist community where users share media. With multiple enclosures it would be possible to aggregate the most shared tracks in multiple playlist formats. Below a single playlist is enclosed in three different versions.
<enclosure title="Webjay.org's daily playlist" xmlns="http://www.solitude.dk/syndication/enclosures/">
<link type="audio/x-mpegurl" length="100" url="http://www.domain.com/playlist.m3u" />
<link type="application/xspf+xml" length="100" url="http://www.domain.com/playlist.xml" />
<link type="application/smil" length="100" url="http://www.domain.com/playlist.smil" />
</enclosure>
This is the personal website of Andreas Haugstrup Pedersen: commentary on media, communication, culture and technology. Read more»
Hallo!
I've found your post very interesting since I'm dealing with RSS feed with the need of multiple enclosures. This post is dated 2005, did you go on with your research till a standard?! I tought to use the yahoo's MRSS standard to solve my problem, it seems fit.. what do you think?
Thanx
cheers
Yahoo mRSS is most definitely the way to go when it comes to these problems. Accepts no substitutes.
Thanks for the post.. I'm having problems getting IMAGES to actually show in my rss feeds. Are enclosures supposed to actually show, or simply be available for other websites to use??
Here is an example of a rss feed with images that show in Firefox's default rss reader: http://feeds.feedburner.com/cssremix
Is it possible to get images to show like this with enclosures??
Thanks in advance.
PS - I created an rss feed like the cssremix and used feedvalidator and it validated just fine. That makes me wonder what the advantages are of your method.
Add your comment