Using Modules in Your RSS Feed - blogChannel Module
(Page 2 of 4 )
Designed by Dave Winer only a week after he formalized RSS 2.0, the blogChannel module allows the inclusion of data used by weblogging applications and, specifically, the newer generation of aggregating and filtering systems.
It consists of three optional elements, all of which are subelements of channel and have the following namespace declaration:
xmlns:blogChannel="http:// backend.userland.com/blogChannelModule"
The elements are:
blogChannel:blogRoll
Contains a literal string that is the URL of an OPML file containing the blogroll for the site. A blogroll is the list of blogs the blog author habitually reads.
blogChannel:blink
Contains a literal string that is the URL of a site the blog author recommends the reader visits.
blogChannel:mySubscriptions
Contains a literal string that is the URL of the OPML file containing the URLs of the RSS feeds to which the blog author is subscribed in her desktop reader.
Example 4-4 shows the beginning of an RSS 2.0 feed using the blogChannel module.
Example 4-4. An RSS 2.0 feed with the blogChannel module
<?xml version="1.0"?>
<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/
blogChannelModule">
<channel>
<title>RSS2.0Example</title>
<link>http://www.exampleurl.com/example/ index.html</link>
<description>This is an example RSS 2.0 feed</description>
<blogChannel:blogRoll>http:// www.exampleurl.com/blogroll.opml </blogChannel:blogRoll> <blogChannel:blink>http://www.benhammersley.com
</blogChannel:blink> <blogChannel:mySubscriptions>http:// www.exampleurl.com/mySubscriptions.opml </blogChannel:mySubscriptions>
...
Creative Commons Module
Also designed by Dave Winer, the Creative Commons module allows RSS 2.0 feeds to specify which Creative Commons license applies to them. The Creative
Commons organization, http://creativecommons.org/, offers a variety of content licenses that allow feed publishers to release content under more flexible copyright restrictions than previously available. Feed consumers can consult the license to see how they can reuse the content for their own work.
The element can apply to either the complete channel or the individual item.
It consists of only one element, creativeCommons:license, which contains the URL of the Creative Commons license on the Creative Commons site. It has the following namespace declaration:
xmlns:creativeCommons="
http://backend.userland.com/ creativeCommonsRssModule"
In action, it looks like Example 4-5.
Example 4-5. Part of an RSS 2.0 feed with the Creative Commons module
<rss version="2.0" xmlns:creativeCommons="http://backend.userland.com/
creativeCommonsRssModule">
<channel>
<title>Creative Commons Example</title> <link>http://www.example.com/</link> <creativeCommons:license>http:// www.creativecommons.org/licenses/by-nd/1.0 </creativeCommons:license>
...
<item>
<description>blah blah blah</description> <creativeCommons:license>http:// www.creativecommons.org/licenses/by-nc/1.0
</creativeCommons:license>
</item>
...
Note that a creativeCommons:license element on an item overrides the same on the channel for that item.
More details can be found at:
http://backend.userland.com/creativeCommonsRssModule
Next: Simple Semantic Resolution Module >>
More XML Tutorials Articles
More By O'Reilly Media
|
This article is excerpted from chapter four of the book Developing Feeds with RSS and Atom, written by Ben Hammersley (O'Reilly; ISBN: 0596008813). Check it out today at your favorite bookstore. Buy this book now.
|
|