Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Why RSS Slash is Popular - Counting Your Comments

Before the word blog was coined there was Slashdot. Slashdot is one of the most popular blogs on the Internet. With its own history and culture, it's responsible for the "First Post!" phenomena, the Anonymous Coward, and the recognition of the Slashdot Effect, a phenomena that adorns its name.

One of the quirks of Slashdot is that it includes a comments count, a humorous department, a hit parade, and a section with every blog post. RSS does not have any facilites for including this information in an <item>, so the RSS Slash Module exists to fill in this gap. An example using the most popular element of the RSS Slash Module is shown below:

   <?xml version="1.0">
   
   <rss version="2.0"
       xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
   >
   
       <channel>
           <title>Example</title>
           <description>An RSS Example with Slash</description>
           <lastBuildDate>Sun, 15 May 2005 13:02:08 -0500</lastBuildDate>
           <link>https://www.example.com</link>
   
           <item>
               <title>Review of Sin City</title>
               <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/114</guid>
               <pubDate>Sun, 15 May 2005 13:02:08 -0500</lastBuildDate></pubDate>
               <link>https://www.example.com/blog/2005/05/15/114</link>
               <slash:comments>43</slash:comments>
           </item>
   
           <item>
               <title>What is the 3571st Prime Number</title>
               <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/113</guid>
               <pubDate>Sun, 15 May 2005 10:55:12 -0500</lastBuildDate></pubDate>
               <link>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/113</link>
               <slash:comments>72</slash:comments>
           </item>
   
           <item>
               <title>First Article!</title>
               <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/112</guid>
               <pubDate>Sun, 15 May 2005 08:14:11 -0500</lastBuildDate></pubDate>
               <link>https://www.example.com/blog/2005/05/15/112</link>
               <slash:comments>118</slash:comments>
           </item>
       </channel>
   
   </rss>

The <slash:comments> element is it reason that the RSS Slash Module is popular. This element gives the (current) total number of comments made for the item -- for the blog post.

Although not necessary, people also often use other RSS Modules to get at (and read) the comments (since RSS does not currently provide facilities for this either). Some use the Well-Formed Web RSS Module for this. And some are now using Atomic RSS for this. (Using either of these 2 RSS modules is out of the scope of this article.)

In reality, an item's comments count could change at any given time. People can (potentially) post new comments to an item at any given time. And (SPAM) comments could get deleted. And thus the comments count that the <slash:comments> element provides is only a snapshot; it was only the comment count at a moment in time. One of the shortcomings of the <slash:comments> element is that does not tell you what that moment in time was. One could assume that the comment count was acurate at the moment in time specified in the <channel>'s <lastBuildDate> element, but that is a risky assumption given that no where is that mandated. And that RSS feeds that are aggregations of other RSS feeds will not be able to assert this.

Document Tags and Contributors

Tags: 
 Contributors to this page: teoli, Brettz9, Nickolay, NickolayBot, Charles
 Last updated by: teoli,