コメント付 RSS のテンプレート

コメント付 RSS のテンプレート(for Movable Type)を掲載します。このテンプレートでは本文も RSS に含めています。

少しでも全文掲載&コメント付の RSS が増えてくれると私が RSSリーダーで閲覧するのが楽になります 🙂

エントリーとコメントが別れている例

<?xml version="1.0" encoding="<$MTPublishCharset$>"?>

<rdf:RDF
  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:cc="http://web.resource.org/cc/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns="http://purl.org/rss/1.0/">

<channel rdf:about="<$MTBlogURL$>">
<title><$MTBlogName encode_xml="1"$></title>
<link><$MTBlogURL$></link>
<description><$MTBlogDescription encode_xml="1"$></description>
<dc:language>ja</dc:language>
<dc:creator></dc:creator>
<dc:date><MTEntries lastn="1"><$MTEntryDate format="%Y-%m-%dT%H:%M:%S" language="en"$><$MTBlogTimezone$></MTEntries></dc:date>
<admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=<$MTVersion$>" />
<MTBlogIfCCLicense>
<cc:license rdf:resource="<$MTBlogCCLicenseURL$>" />
</MTBlogIfCCLicense>

<items>
<rdf:Seq>
<MTEntries lastn="15">
<rdf:li rdf:resource="<$MTEntryPermalink encode_xml="1"$>" /><MTEntryIfAllowComments><MTComments>
<rdf:li rdf:resource="<$MTEntryPermalink encode_xml="1"$>#<$MTCommentID encode_xml="1"$>" /></MTComments></MTEntryIfAllowComments>
</MTEntries></rdf:Seq>
</items>

</channel>

<MTEntries lastn="15">
<item rdf:about="<$MTEntryPermalink encode_xml="1"$>">
<title><$MTEntryTitle encode_xml="1"$></title>
<link><$MTEntryPermalink encode_xml="1"$></link>
<description><$MTEntryExcerpt encode_xml="1"$></description>
<content:encoded><$MTEntryBody encode_xml="1"$><$MTEntryMore encode_xml="1"$></content:encoded>
<dc:subject><$MTEntryCategory encode_xml="1"$></dc:subject>
<dc:creator><$MTEntryAuthor encode_xml="1"$></dc:creator>
<dc:date><$MTEntryDate format="%Y-%m-%dT%H:%M:%S"$><$MTBlogTimezone$></dc:date>
</item>

<MTEntryIfAllowComments>
<MTComments>

<item rdf:about="<$MTEntryPermalink encode_xml="1"$>#<$MTCommentID encode_xml="1"$>">
<title>⇒ <$MTCommentAuthor encode_xml="1"$> at <$MTCommentDate format="%Y.%m.%d" encode_xml="1"$></title>
<link><$MTEntryPermalink encode_xml="1"$>#<$MTCommentID encode_xml="1"$></link>
<description><$MTCommentBody convert_breaks="0" words="5" encode_xml="1"$></description>
<content:encoded><$MTCommentBody encode_xml="1"$></content:encoded>
<dc:subject><$MTEntryCategory encode_xml="1"$></dc:subject>
<dc:creator><$MTCommentAuthor encode_xml="1"$></dc:creator>
<dc:date><$MTCommentDate format="%Y-%m-%dT%H:%M:%S"$><$MTBlogTimezone$></dc:date>
</item>

</MTComments>
</MTEntryIfAllowComments>

</MTEntries>

</rdf:RDF>

注1:古いエントリーに対する最近のコメントは抽出できません
注2:掲載版は実際に使っているものを若干修正したのでちゃんとテストしておりません。うまく動作しなかったらお知らせ下さい

Tags: ,

Leave a Reply