x
 
Create New Page
 View Previous Changes    ( Last updated by Bobby McGee )

Making an RSS feed of all comments to all posts

Here’s how to do it. Pretty straight-forward and simple, all you have to do is copy and paste this code into an empty template.

Remember to change the weblog info as needed. *smile* If you want the comment permalinks to turn out correctly, see this article: Comment Permalinks

{assign_variable:master_weblog_name="default_site"}
{exp
:rss:feed weblog="{master_weblog_name}"}
<?xml version
="1.0" encoding="{encoding}"?>
<rss version="2.0"
  
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:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  
xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <
channel>
    <
title>{exp:xml_encode}Comments for {weblog_name}{/exp:xml_encode}</title>
    <
link>{weblog_url}</link>
    <
description>{weblog_description}</description>
    <
dc:language>{weblog_language}</dc:language>
    <
dc:creator>{author} {email} {if url}{url}{/if}</dc:creator>
    <
pubDate>{exp:comment:entries limit="1"  sort="desc" orderby="date" rdf="off" dynamic_start="on" dynamic="off"}{comment_date format="%r"}{/exp:comment:entries}</pubDate>
    <
admin:generatorAgent rdf:resource="http://www.pmachine.com/" />
    
{exp:comment:entries limit="50" sort="desc" orderby="date" rdf="off" dynamic_start="on" dynamic="off"} <item>
    <
title>Comment on {exp:xml_encode}{title} by {name}{/exp:xml_encode}</title>
    <
link>{comment_url_title_auto_path}#{comment_id}</link>
<guid>{comment_url_title_auto_path}#{comment_id}</guid>
    
<description><![CDATA[
{comment}
]]
></description>
    <
dc:creator>{exp:xml_encode}{name}{/exp:xml_encode}</dc:creator>
    <
pubDate>{comment_date format="%r"}</pubDate>
    </
item>
    
{/exp:comment:entries}
  
</channel>
</
rss>
{/exp:rss:feed}

Credit: EE forum reply: Making an RSS feed of comments, post 8.

Category:RSS Category:Comments Category:Templates

Categories: