Blogging Roller

Dave Johnson on open web technologies, social software and software development

Re: Joe Hewitt Comments

Hey Matt, don't bring JSP into it. You could probably do this in Roller 0.9.7 without even making a code change. Just use the Roller Editor UI to add a new page template to your site to produce comments in Hewitt's XML format:

   #set( $comments = $allComments )
   <comments>
   #foreach( $comment in $comments )
   <comment id="$comment.id">
      <author>$comment.name</author> 
      <email>$entry.email</email>
      <url>$entry.url</url>
      <timestamp>$comment.postTime</timestamp>
      <body>
         $comment.content
      </body>
   </comment>
   #end
   </comments>
Assuming that the page above is named 'Comments' then the URL to call it and retrieve the comments for your post would look like this:
http://www.raibledesigns.com/comments/rd/Comments?anchor=joe_hewitt_comments
UPDATE: I made a couple of corrections and additions to the code above and the the URL; these are shown in bold.

Dave Johnson in Roller • 🕒 01:53PM Apr 17, 2003
Tags: Roller
Comments:

Very cool - I'll have to try that - I'm assuming that will give me the comments for the first post only. Now the question is - what in the "comment" object will give me the email and url information. I'm lazy - I suppose I should look at the JavaDocs.

Posted by Matt Raible on April 18, 2003 at 05:09 PM EDT #

Post a Comment:
  • HTML Syntax: NOT allowed