[ Team LiB ] Previous Section Next Section

13.7 Creating Your Own RSS Content

RSS allows you to aggregate like items, though you don't have to restrict this to web pages and news sources and things like that. For instance, one effective use of RSS would be to keep lists of multimedia recommendations such as books, music, and movies.

I use RSS to maintain a list of book recommendations from friends. For the most part, the RSS elements and the DC module define most of the data I want to capture, including the dc:creator, dc:subject, and the standard RSS channel, items, and item. However, within the core RSS 1.0 specification, a few useful fields are missing. Among these are elements to record who made the recommendation, the URL of her web site, whether the book has been read (or the movie has been viewed), and an URL of the review if any. Since the business I'm interested in documenting—book recommendations—isn't fully covered or predefined in any existing RDF vocabulary or within any existing RSS 1.0 module I could find, I created one of my own, with the following namespace:

xmlns:recs="http://burningbird.net/recommendations/elements/1.0/"

I then defined the following elements in the namespace:

recby

Name of person who made the recommendation (optional), PCDATA

status

Status of recommendation (required; 1=consumed, 0=unconsumed)

reclink

URL of web site of recommendation or recommender (optional)

review

URL of review (optional)

I asked around with some of my friends and ended up with a selection of book recommendations, which I then recorded in my newly extended RSS. Example 13-5 shows an abbreviated book recommendations list.

Example 13-5. Book recommendation RSS
<?xml version="1.0"?>

<rdf:RDF 
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
xmlns:dc="http://purl.org/dc/elements/1.1/" 
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" 
xmlns:recs="http://burningbird.net/recommendations/elements/1.0/" 
xmlns="http://purl.org/rss/1.0/">

<channel rdf:about="http://weblog.burningbird.net/books.rdf">
<title>Burningbird BookList</title>
<link>http://weblog.burningbird.net/books.rdf</link>
<description>
Burningbird's To Be Read Booklist and Recommendations
</description>

<items>
<rdf:Seq>
<rdf:li rdf:resource="http://isbn.nu/0395489016" />
<rdf:li rdf:resource="http://isbn.nu/0446391301" />
<rdf:li rdf:resource="http://isbn.nu/0679454519" />
<rdf:li rdf:resource="http://isbn.nu/0743418174" />
<rdf:li rdf:resource="http://isbn.nu/0553211161" />
</rdf:Seq>
</items>

</channel>

<item rdf:about="http://isbn.nu/0446391301">
<title>Geek Love</title>
<description></description>
<dc:creator>Katherine Dunn</dc:creator>
<dc:subject>Fiction</dc:subject>
<dc:subject>Drama</dc:subject>
<dc:identifier>0446391301</dc:identifier>
<link>http://isbn.nu/0446391301/price/1</link>
<recs:recby>Denise Howell</recs:recby>
<recs:status>0</recs:status>
<recs:reclink>http://bgbg.blogspot.com/</recs:reclink>
</item>

<item rdf:about="http://isbn.nu/0743418174">                                 
<title>Good in Bed</title>
<description></description>
<dc:creator>Jennifer Weiner</dc:creator>   
<dc:subject>Fiction</dc:subject>
<link>http://isbn.nu/0743418174/price/1</link>                                 
<recs:recby>Leesa</recs:recby>
<recs:read>unread</recs:read>
<recs:reclink>http://leesa.devfarm.com/</recs:reclink>
</item>

<item rdf:about="http://isbn.nu/0553211161">                                 
<title>Leaves of Grass</title>
<description></description>
<dc:creator>Walt Whitman</dc:creator>   
<dc:subject>Poetry</dc:subject>
<link>http://isbn.nu/0553211161/price/1</link>                                 
<recs:recby>bumr</recs:recby>
<recs:read>unread</recs:read>
<recs:reclink>http://bumr.net/</recs:reclink>
</item>

<item rdf:about="http://isbn.nu/0679742115/">
<title>Vox</title>
<description></description>
<dc:creator>Nicholson Baker</dc:creator>
<dc:subject>Fiction</dc:subject>
<link>http://isbn.nu/0679742115/</link>
<recs:recby>Karl aka Paradox1x</recs:recby>
<recs:reclink>http://www.paradox1x.org/html/books.shtml
  </recs:reclink>
<recs:read>unread</recs:read>
</item>

<item rdf:about="http://isbn.nu/0395489016">                
<title>Let Us Now Praise Famous Men</title>
<description></description>           
<dc:creator>James Agee, Walker Evans</dc:creator>
<dc:subject>Nonfiction</dc:subject>
<link>http://isbn.nu/0395489016</link>                
<recs:recby>Jonathon Delacour</recs:recby>
<recs:reclink>http://weblog.delacour.net</recs:reclink>      
<recs:status>1</recs:status>
<recs:review>http://weblog.burningbird.net/archives/000442.php
  </recs:review>
</item>

</rdf:RDF>

Though there is no description for each of the book items, the description elements are still listed because this element is mandatory. Of course, the next step to take would be to formalize the Recommendations module through the RSS Working Group, but for now, we'll accept it the way it is. In the next section, we'll look at a couple of different applications to process this data.

    [ Team LiB ] Previous Section Next Section