記事本文
コメントの投稿状況を配信する RSS 1.0 テンプレート
<?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:content="http://purl.org/rss/1.0/modules/content/"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:admin="http://webns.net/mvcb/"
xmlns:cc="http://web.resource.org/cc/"
xmlns="http://purl.org/rss/1.0/">
<channel rdf:about="<$MTBlogURL$>">
<title>Comment of <$MTBlogName remove_html="1" encode_xml="1"$></title>
<link><$MTBlogURL$></link>
<description><$MTBlogName remove_html="1" encode_xml="1"$> に寄せられたコメント</description>
<dc:language><$MTDefaultLanguage$></dc:language>
<dc:creator><MTEntries lastn="1"><$MTEntryAuthor encode_xml="1"$></MTEntries></dc:creator>
<dc:date><MTComments lastn="1"><MTCommentEntry><$MTEntryDate format="%Y-%m-%dT%H:%M:%S" language="en"$><$MTBlogTimezone$></MTCommentEntry></MTComments></dc:date>
<admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=<$MTVersion$>" />
<MTBlogIfCCLicense>
<cc:license rdf:resource="<$MTBlogCCLicenseURL$>" />
</MTBlogIfCCLicense>
<items>
<rdf:Seq>
<MTComments lastn="15" sort_order="descend">
<MTCommentEntry><rdf:li rdf:resource="<$MTEntryPermalink encode_xml="1"$>#comment-<$MTCommentID$>" /></MTCommentEntry>
</MTComments>
</rdf:Seq>
</items>
</channel>
<MTComments lastn="15" sort_order="descend">
<MTCommentEntry>
<item rdf:about="<$MTEntryPermalink encode_xml="1"$>#comment-<$MTCommentID$>">
<title>"<$MTEntryTitle remove_html="1" encode_xml="1"$>"への<$MTCommentAuthor default="Anonymous" encode_xml="1"$>さんのコメント</title>
<link><$MTEntryPermalink encode_xml="1"$>#comment-<$MTCommentID$></link>
<description><$MTCommentBody encode_xml="1" convert_breaks="0" trim_to="30"$>...</description>
<content:encoded>
<$MTCommentBody remove_html="1" encode_xml="1" convert_breaks="0"$>
<MTEntryIfCommentsOpen>
<![CDATA[<a href="<$MTEntryPermalink encode_xml="1"$>#comments-open">"<$MTEntryTitle remove_html="1" encode_html="1"$>"へコメントを投稿する</a>]]>
</MTEntryIfCommentsOpen>
</content:encoded>
<dc:creator><$MTCommentAuthor default="Anonymous" encode_xml="1"$></dc:creator>
<dc:date><$MTCommentDate format="%Y-%m-%dT%H:%M:%S" language="en"$><$MTBlogTimezone$></dc:date>
<dc:source><$MTEntryPermalink encode_xml="1"$></dc:source>
</item>
</MTCommentEntry>
</MTComments>
</rdf:RDF>
コメントの投稿状況を配信する RSS 2.0 テンプレート
<?xml version="1.0" encoding="<$MTPublishCharset$>"?>
<rss version="2.0">
<channel>
<title>Comment of <$MTBlogName remove_html="1" encode_xml="1"$></title>
<link><$MTBlogURL$></link>
<description><$MTBlogName remove_html="1" encode_xml="1"$> に寄せられたコメント</description>
<language><$MTBlogLanguage ietf="1"$></language>
<copyright>Copyright <$MTDate format="%Y"$></copyright>
<lastBuildDate><MTComments lastn="1"><MTCommentEntry><$MTEntryDate format_name="rfc822"$></MTCommentEntry></MTComments></lastBuildDate>
<generator>http://www.sixapart.com/movabletype/?v=<$MTVersion$></generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<MTComments lastn="15" sort_order="descend">
<MTCommentEntry>
<item>
<title>"<$MTEntryTitle remove_html="1" encode_xml="1"$>"への<$MTCommentAuthor default="Anonymous" encode_xml="1"$>さんのコメント</title>
<description>
<$MTCommentBody remove_html="1" encode_xml="1" convert_breaks="0"$>
<MTEntryIfCommentsOpen>
<![CDATA[<a href="<$MTEntryPermalink encode_xml="1"$>#comments-open">"<$MTEntryTitle remove_html="1" encode_html="1"$>"へコメントを投稿する</a>]]>
</MTEntryIfCommentsOpen>
</description>
<link><$MTEntryPermalink encode_xml="1"$>#comment-<$MTCommentID$></link>
<guid><$MTEntryPermalink encode_xml="1"$>#comment-<$MTCommentID$></guid>
<pubDate><$MTCommentDate format_name="rfc822"$></pubDate>
</item>
</MTCommentEntry>
</MTComments>
</channel>
</rss>
コメントの投稿状況を配信する Atom テンプレート
- 生成サンプルは hxxk.jp のコメントの投稿状況 ( Atom ) をご覧ください。
- コメント文にマルチバイト文字と 1 バイト文字が混在した場合に、 trim_to による文字列トリミングがうまくいかない場合がありますので、気になる場合は SG::Acme : マルチバイトな文字列を切り詰めるなどの方法による対処をする必要があります。
- 出力ファイル名を comment_atom.xml 以外にする場合は、
<link rel="self" type="application/atom+xml" href="<$MTBlogURL$>comment_atom.xml" /> 部分を合わせて変更する必要があります。
<?xml version="1.0" encoding="<$MTPublishCharset$>"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Comment of <$MTBlogName remove_html="1" encode_xml="1"$></title>
<link rel="alternate" type="text/html" href="<$MTBlogURL encode_xml="1"$>" />
<link rel="self" type="application/atom+xml" href="<$MTBlogURL$>comment_atom.xml" />
<id>tag:<$MTBlogHost exclude_port="1" encode_xml="1"$>,<MTArchiveList archive_type="Monthly" sort_order="ascend" lastn="1"><$MTArchiveDate format="%Y"$></MTArchiveList>:<$MTBlogRelativeURL encode_xml="1"$>/<$MTBlogID$></id>
<updated><MTComments lastn="1"><MTCommentEntry><$MTCommentDate utc="1" format="%Y-%m-%dT%H:%M:%SZ"$></MTCommentEntry></MTComments></updated>
<subtitle><$MTBlogName remove_html="1" encode_xml="1"$> に寄せられたコメント</subtitle>
<generator uri="http://www.sixapart.com/movabletype/">Movable Type <$MTVersion$></generator>
<MTComments lastn="15" sort_order="descend">
<MTCommentEntry>
<entry>
<title>"<$MTEntryTitle remove_html="1" encode_xml="1"$>"への<$MTCommentAuthor default="Anonymous" encode_xml="1"$>さんのコメント</title>
<dc:source><$MTEntryPermalink encode_xml="1"$></dc:source>
<link rel="alternate" type="text/html" href="<$MTEntryPermalink encode_xml="1"$>#comment-<$MTCommentID$>" />
<id><$MTEntryAtomID$><$MTCommentID$></id>
<published><$MTEntryDate utc="1" format="%Y-%m-%dT%H:%M:%SZ"$></published>
<updated><$MTCommentDate utc="1" format="%Y-%m-%dT%H:%M:%SZ"$></updated>
<summary><$MTCommentBody remove_html="1" encode_xml="1" convert_breaks="0" trim_to="30"$>...</summary>
<author>
<name><$MTCommentAuthor default="Anonymous" encode_xml="1"$></name>
<MTIfNonEmpty tag="MTCommentURL"><uri><$MTCommentURL encode_xml="1"$></uri></MTIfNonEmpty>
</author>
<content type="html" xml:lang="<$MTBlogLanguage ietf="1"$>" xml:base="<$MTBlogURL encode_xml="1"$>">
<$MTCommentBody remove_html="1" encode_xml="1" convert_breaks="0"$>
<MTEntryIfCommentsOpen>
<![CDATA[<a href="<$MTEntryPermalink encode_xml="1"$>#comments-open">"<$MTEntryTitle remove_html="1" encode_html="1"$>"へコメントを投稿する</a>]]>
</MTEntryIfCommentsOpen>
</content>
</entry>
</MTCommentEntry>
</MTComments>
</feed>
トラックバックの受信状況を配信する RSS 1.0 テンプレート
<?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:content="http://purl.org/rss/1.0/modules/content/"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:admin="http://webns.net/mvcb/"
xmlns:cc="http://web.resource.org/cc/"
xmlns="http://purl.org/rss/1.0/">
<channel rdf:about="<$MTBlogURL$>">
<title>Trackback of <$MTBlogName remove_html="1" encode_xml="1"$></title>
<link><$MTBlogURL$></link>
<description><$MTBlogName remove_html="1" encode_xml="1"$> に寄せられたトラックバック</description>
<dc:language><$MTDefaultLanguage$></dc:language>
<dc:creator><MTEntries lastn="1"><$MTEntryAuthor encode_xml="1"$></MTEntries></dc:creator>
<dc:date><MTPings lastn="1"><MTPingEntry><$MTEntryDate format="%Y-%m-%dT%H:%M:%S" language="en"$><$MTBlogTimezone$></MTPingEntry></MTPings></dc:date>
<admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=<$MTVersion$>" />
<MTBlogIfCCLicense>
<cc:license rdf:resource="<$MTBlogCCLicenseURL$>" />
</MTBlogIfCCLicense>
<items>
<rdf:Seq>
<MTPings lastn="15" sort_order="descend">
<MTPingEntry><rdf:li rdf:resource="<$MTPingURL$>" /></MTPingEntry>
</MTPings>
</rdf:Seq>
</items>
</channel>
<MTPings lastn="15" sort_order="descend">
<MTPingEntry>
<item rdf:about="<$MTPingURL$>">
<title>"<$MTEntryTitle remove_html="1" encode_xml="1"$>"への"<$MTPingBlogName encode_xml="1"$>"からのトラックバック</title>
<link><$MTPingURL$></link>
<description><$MTPingExcerpt encode_xml="1" convert_breaks="0"$></description>
<content:encoded>
<$MTPingExcerpt remove_html="1" encode_xml="1" convert_breaks="0"$>
<MTIfPingsAccepted>
"<$MTEntryTitle remove_html="1" encode_html="1"$>"のトラックバック URL : <$MTEntryTrackbackLink$>
</MTIfPingsAccepted>
</content:encoded>
<dc:creator><$MTPingBlogName encode_xml="1"$></dc:creator>
<dc:date><$MTPingDate format="%Y-%m-%dT%H:%M:%S" language="en"$><$MTBlogTimezone$></dc:date>
<dc:source><$MTEntryPermalink encode_xml="1"$></dc:source>
</item>
</MTPingEntry>
</MTPings>
</rdf:RDF>
トラックバックの受信状況を配信する RSS 2.0 テンプレート
<?xml version="1.0" encoding="<$MTPublishCharset$>"?>
<rss version="2.0">
<channel>
<title>Trackback of <$MTBlogName remove_html="1" encode_xml="1"$></title>
<link><$MTBlogURL$></link>
<description><$MTBlogName remove_html="1" encode_xml="1"$> に寄せられたトラックバック</description>
<language><$MTBlogLanguage ietf="1"$></language>
<copyright>Copyright <$MTDate format="%Y"$></copyright>
<lastBuildDate><MTPings lastn="1"><MTPingEntry><$MTEntryDate format_name="rfc822"$></MTPingEntry></MTPings></lastBuildDate>
<generator>http://www.sixapart.com/movabletype/?v=<$MTVersion$></generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<MTPings lastn="15" sort_order="descend">
<MTPingEntry>
<item>
<title>"<$MTEntryTitle remove_html="1" encode_xml="1"$>"への"<$MTPingBlogName encode_xml="1"$>"からのトラックバック</title>
<description>
<$MTPingExcerpt remove_html="1" encode_xml="1" convert_breaks="0"$>
<MTIfPingsAccepted>
"<$MTEntryTitle remove_html="1" encode_html="1"$>"のトラックバック URL : <$MTEntryTrackbackLink$>
</MTIfPingsAccepted>
</description>
<link><$MTPingURL$></link>
<guid><$MTPingURL$></guid>
<pubDate><$MTPingDate format_name="rfc822"$></pubDate>
</item>
</MTPingEntry>
</MTPings>
</channel>
</rss>
トラックバックの受信状況を配信する Atom テンプレート
<?xml version="1.0" encoding="<$MTPublishCharset$>"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
<title>Trackback of <$MTBlogName remove_html="1" encode_xml="1"$></title>
<link rel="alternate" type="text/html" href="<$MTBlogURL encode_xml="1"$>" />
<link rel="self" type="application/atom+xml" href="<$MTBlogURL$>trackback_atom.xml" />
<id>tag:<$MTBlogHost exclude_port="1" encode_xml="1"$>,<MTArchiveList archive_type="Monthly" sort_order="ascend" lastn="1"><$MTArchiveDate format="%Y"$></MTArchiveList>:<$MTBlogRelativeURL encode_xml="1"$>/<$MTBlogID$></id>
<updated><MTPings lastn="1"><MTPingEntry><$MTPingDate utc="1" format="%Y-%m-%dT%H:%M:%SZ"$></MTPingEntry></MTPings></updated>
<subtitle><$MTBlogName remove_html="1" encode_xml="1"$> に寄せられたトラックバック</subtitle>
<generator uri="http://www.sixapart.com/movabletype/">Movable Type <$MTVersion$></generator>
<MTPings lastn="15" sort_order="descend">
<MTPingEntry>
<entry>
<title>"<$MTEntryTitle remove_html="1" encode_html="1"$>"への"<$MTPingBlogName encode_xml="1"$>"からのトラックバック</title>
<dc:source><$MTEntryPermalink encode_xml="1"$></dc:source>
<link rel="alternate" type="text/html" href="<$MTPingURL$>" />
<id><$MTEntryAtomID$><$MTPingID$></id>
<published><$MTEntryDate utc="1" format="%Y-%m-%dT%H:%M:%SZ"$></published>
<updated><$MTPingDate utc="1" format="%Y-%m-%dT%H:%M:%SZ"$></updated>
<summary><$MTPingExcerpt remove_html="1" encode_xml="1" convert_breaks="0"$></summary>
<author>
<name><$MTPingBlogName encode_xml="1"$></name>
<uri><$MTPingURL encode_xml="1"$></uri>
</author>
<content type="html" xml:lang="<$MTBlogLanguage ietf="1"$>" xml:base="<$MTBlogURL encode_xml="1"$>">
<$MTPingExcerpt remove_html="1" encode_xml="1" convert_breaks="0"$>
<MTIfPingsAccepted>
"<$MTEntryTitle remove_html="1" encode_html="1"$>"のトラックバック URL : <$MTEntryTrackbackLink$>
</MTIfPingsAccepted>
</content>
</entry>
</MTPingEntry>
</MTPings>
</feed>
リプライ
4 件のリプライが送られています。
この記事に対するご意見やご質問、ご感想などありましたら個別記事ページの送信フォームからお送り下さい。
- 2006-04-28T19:47+09:00 - コメント・トラックバックの情報を収集・配信する Feed < まけないこと投げ
-
【真琴によるトラックバック】
コメント・トラックバックの区別を無くしてひとつの RSS 2.0 Feed にするテンプレート。
- 2006-09-18T14:16+09:00 - Nob Seki
-
こんにちは。
Atomのsummaryの中身で、trim_toを使われていますが、この場合は、remove_htmlも併用された方がいいのではないでしょうか。うちでは、HTMLタグが利用可能のため、タグが閉じられる前にtrim_toが効いてしまって、出力がおかしくなることがありました。
- 2006-10-02T20:31+09:00 - 真琴
-
確かに、 remove_html もあった方がいいですね。私のところは HTML タグを使用不可にしていたので失念していました。
MT 3.3 ではコメントやトラックバックの Feed はシステム側で提供されているので、これを使われる方はあまり多くないかもしれませんが。
ところで、関取締役がこのテンプレートについてコメントを書かれているということは、実際に適用をされてみたってことでしょうか……
不完全なものを公開してしまってすみません。
- 2006-10-02T20:38+09:00 - 真琴
-
ということで、テンプレートのコードに remove_html を書き加えました。このテンプレートを使われている方がいらっしゃいましたら、 MTCommentBody および MTPingExcerpt の部分に同様に書き加えるか、新しいコードを用いるようにしてください。