About

I'm Mike Pope. I live in the Seattle area. I've been a technical writer and editor for over 30 years. I'm interested in software, language, music, movies, books, motorcycles, travel, and ... well, lots of stuff.

Read more ...

Blog Search


(Supports AND)

Google Ads

Feed

Subscribe to the RSS feed for this blog.

See this post for info on full versus truncated feeds.

Quote

Google is the greatest programming resource that has ever existed. You cannot look down on someone for using the most powerful learning tool computer science has ever known.

Steven Brenner



Navigation





<July 2014>
SMTWTFS
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

Categories

  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  

Contact

Email me

Blog Statistics

Dates
First entry - 6/27/2003
Most recent entry - 7/23/2014

Totals
Posts - 2304
Comments - 2489
Hits - 1,648,907

Averages
Entries/day - 0.57
Comments/entry - 1.08
Hits/day - 407

Updated every 30 minutes. Last: 1:21 PM Pacific


  12:48 AM

I added a comment feed to the blog. I see this on just a few blogs, as reflected in my aggregator (RSSBandit):



(Courtesy of ComputerZen.com in this case.)

It was not 100% clear to me what exactly to implement, elements wise. I got the original comment API spec from the Well-Formed Web site. I also poked around in a couple of existing comment feeds, including Scott Hanselman's comment feed and the comment feed from the ASP.NET Web logs site. The three sources didn't completely agree about what elements to provide, but as Joe Gregorio says on the Well-Formed Web site:
... the contents of the 'item' element are guided by the RSS 2.0 specification, which states that all elements are optional, but requires that at least one of 'title' or 'description' are present.
All right, then.

If you want to see what it looks like, have a peek at this feed:

http://www.mikepope.com/blog/blogcommentsfeed.ashx?id=1457

You might note that this feed is implemented as an ASP.NET HTTP handler, which conforms to a, er, suggestion from Nikhil. (The main feed is implemented as a Web service.) The extension is .ashx, the default handler. One day Real Soon Now I'll get around to remapping the .rss extension to the ASP.NET ISAPI and configuring the blog app to handle that.

To expose the comment feed, I updated the main feed (http://mikepope.com/blog/blogfeed.asmx/GetRSS?) to include a couple of new elements, including <wfw:commentRss/> and <slash:comments/>. This required that I learn how to specify a namespace and prefix for an element ... you learn something new every day, it seems.

So this was all fun and stuff. I'll describe another day how I went about creating the RSS for this, which I'll note for now did not involve creating an XmlDocument and populating it element by element.

One slight problem, though: as at this moment, my aggregator is not actually recognizing that I have a comment feed available. I've looked over the main feed, and it seems to be listing the comment feed URL properly. And the comment feed seems to be well-formed and all that. So I don't know what's wrong exactly, unless it's a problem with cache latency or something. Or I'm fundamentally not understanding how this comment-feed thing works.

If you've got any insights, I'd sure like to hear them. Or, of course, if this actually works in your aggregator, or -- horrors -- if it horks things up.

Update Ok, I got it. Once again I am flummoxed by dynamically creating XML elements. I ended up having to do something like this:
Dim commentRSS, commentCount As XmlElement
commentRss = doc.CreateElement("wfw", "commentRss", "http://wellformedweb.org/CommentAPI/")
commentCount = doc.CreateElement("slash", "comments", "http://purl.org/rss/1.0/modules/slash/")
IOW, I had to pass the XML namespace URI explicitly in the create method even though all the namespaces are declared in the <rss/> block at the top of the XML file. It'd be nice not to have to do this. Also, I obviously need to understand more about XML manipulation. All the more then, for doing the comment feed the way I did, as you'll see ...

[categories]  

[1] |