How to create an RSS1.0 feed in Roller 3.1

Of the many feed formats, only two have long term viability: Atom and RSS 1.0. RSS1.0 is an rdf crystallization, which means that it is easy to parse using simple xml DOM and xslt tools and also very easy to extend. It is easy to extend because it is RDF, and so the interpretation of the extensions are given automatically by the rdf semantics. In the Atom world, understanding extensions always requires one to find the particular RFC for the extension (if there is one) and read it carefully. Machines cannot do very much with atom extensions, other than ignore them. RSS1.0 extensions on the other hand can be processed and partially understood by RDF tools, even if they never heard about them before.

Roller automatically creates Atom feeds now (I added mine a while back). Here is how to create an RSS1.0 feed in the latest version of Roller (which now supports tagging).

  1. Log in to your roller account
  2. Click on the Preferences Tab
  3. Click on Templates
  4. In the "Add a new template" entry box add a name such as rss10.xml (make sure your file name ends in xml, and click add.
  5. In the form add the following template
    <?xml version="1.0" encoding='utf-8'?>
    <rdf:RDF xmlns="http://purl.org/rss/1.0/"
             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:admin="http://webns.net/mvcb/"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
     #set($blg = $model.weblog)
     #set($items = $model.weblog.getRecentWeblogEntries("SemWeb", 25))
     <channel rdf:about="$url.home">
       <title>$utils.escapeXML($blg.name)</title>
       <link>$url.home</link>
       <description>$utils.escapeXML($blg.description)</description>        
       <dc:date>$utils.formatIso8601Date($blg.lastModified)</dc:date>
       <admin:generatorAgent rdf:resource="http://rollerweblogger.org/"/>
       <items>
          <rdf:Seq>
          #foreach($item in $items)
            <rdf:li rdf:resource="$item.permalink"/>
          #end
          </rdf:Seq>
       </items>
     </channel>
    
    #foreach($item in $items)
      <item rdf:about="$item.permalink">
         <title>$utils.removeHTML($item.title)</title>
         <link>$item.permalink</link>
         <dc:date>$utils.formatIso8601Date($item.updateTime)</dc:date>
         <dc:creator>$item.creator.fullName</dc:creator>
         <foaf:maker xmlns:foaf="http://xmlns.com/foaf/0.1/">
            <foaf:Person rdf:about="http://bblfish.net/people/henry/card#me">
              <foaf:name>$item.creator.fullName</foaf:name>
            </foaf:Person>
         </foaf:maker>
         #foreach ($cat in $item.categories)
         <dc:subject>$cat.name</dc:subject>
         #end
         #foreach ($tag in $item.tags)
         <dc:subject>$tag.name</dc:subject>     
         #end
         #if( $utils.isNotEmpty($item.summary) )
         <description>$utils.escapeXML($item.transformedSummary)</description>
         #end
         #if( $utils.isNotEmpty($item.text) )
         <content:encoded>$utils.escapeXML($item.transformedText)</content:encoded>
         #end
      </item>
    #end
    </rdf:RDF>
    
  6. adapt the above to your needs.
    • The above feed only selects entries from the "SemWeb" category. If you would like to have all entries appear replace the SemWeb above with nill
    • http://bblfish.net/people/henry/card#me is my web 2.0 name. If you have your own, make sure to replace mine with yours, otherwise remove the rdf:about="..." attribute from the template.
  7. Your rss feed is now available at http://blogs.sun.com/${blogname}/page/rss10.xml. Mine is available http://blogs.sun.com/bblfish/page/rss10.xml

Comments:

[Trackback] By default Roller 3.0 provides provides Atom 1.0 and RSS 2.0 format feeds for each blog, but you can easily add other formats. In his latest blogs.sun.com post, Henry Story explains how to add an RSS 1.0 feed to your Roller blog using the new Roller ...

Posted by Blogging Roller on November 06, 2006 at 06:47 PM CET #

Post a Comment:
Comments are closed for this entry.
About

bblfish

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today