April 06, 2003

Putting A License Header on Your RSS Feed

A few days ago, I got a phone call from a friend who thought someone was including his RSS feed in a premium feed service, even thought the copyright and license information on the site itself clearly indicates that the work is licensed only for non-commercial use, including, of course, the RSS feed.

But if someone never visits your site, only reading the RSS feed, how can you alter them to the terms of the license (and hopefully deter possible non-permitted uses of your feed)? It's easy - simply include an item containing information about the feed, including desired copyright and license info.

I have done something similar for a while now, using Movable Type's automated templates for RSS feeds. The first item in my thread is always the item entitled "About this Weblog" containing a brief description of the weblog. It always appears as the first item in NetNewsWire when I read my own feed, and certainly it would be the first thing a new reader sees the first time reading the feed.

Here's how to do it in Movable Type, and you can pretty much use the same basic idea no matter how you generate your feed.

First, take a look at your feed in raw text form. You'll see that, after the initial headers, each news item is marked by <ITEM> tags. Inside that, you'll see the components: TITLE, LINK, DESCRIPTION, CONTENT, and maybe a couple of other components. You'll want to open up a text editor and create a new "item" based on what you see in your feed. You can see, in the extended entry, what mine look like for both the RSS 1.0 and 2.0 templates.

Next, you'll want to go to you Movable Type setup page, under "Templates." Depending on your setup, you may be generating a feed for RSS 1.0, 2.0, or both. (Check and see whether your front page has a link to the index.xml or the index.rdf file - that will tell you which you need to edit). Select the appropriate template, and find the MTEntries tag. You'll want to take the item you prepared above (again, depending on which spec you use) and paste it into the template BEFORE the MTEntries tag. Save it, rebuild the site (just the index files should do it), and that should be it. Any reader of your RSS feed will now see your license information as that first item.

My item entries look like this:

RSS 2.0


<item>
<title>About This Weblog</title>
<link>http://perpetualbeta.com/woifm/</link>
<description>What's On It For Me? is a Perpetual Beta
Production.</description>
<content:encoded>
<![CDATA[<p>What's On It For Me? is a <a
href="http://perpetualbeta.com/">Perpetual Beta</a>
Production <img src="http://perpetualbeta.com/beta-dot.gif">
</p><p>The site and this RSS feed are Copyright 1999 -
2003 by Michael Alex Wasylik. All Rights are reserved. Please <a
href="http://perpetualbeta.com/contact/">contact the author
</a> for reprint or duplication permission. </p>]]>
</content:encoded>
<dc:subject>General</dc:subject>
</item>


RSS 1.0

<item rdf:about="http://perpetualbeta.com/woifm/">
    <title>About This Weblog</title>
    <description>What's On It For Me? is a Perpetual Beta Production.
    </description>
    <content:encoded><![CDATA[<p>What's On It For Me? is a 
    <a href="http://perpetualbeta.com/">Perpetual Beta</a>
    Production <img src="http://perpetualbeta.com/beta-dot.gif">
    </p><p>The site and this RSS feed are Copyright 1999-2003 
    by Michael Alex Wasylik.   All Rights are reserved.  Please <a 
    href="http://perpetualbeta.com/contact/">contact the author</a> 
    for reprint or duplication permission. </p>]]>
    </content:encoded>
    <link>http://perpetualbeta.com/woifm/</link>
    <dc:subject>General</dc:subject>
    <dc:creator>wasylik</dc:creator>
    </item>
Posted by wasylik at April 6, 2003 10:20 PM | TrackBack
Comments
Post a comment









Remember personal info?