在MT中把迴響作成RSS

blog一個迷人的地方,就是你可以用rss把一堆blog串起來,不管你是用類似火車時刻表的程式,還是用RSS reader,都可以在自己的家裡,得知全世界各地blog的更新狀態。有時候,你會看到某篇文章,覺得有話要說,從而留下了迴響(Comments),然後繼續流連在茫茫的blog海中。除非你對該篇文章特別有興趣,否則在一段時間之後,會回來看有沒有新的迴響的機會少之又少。
因為如此,趁著這難得的美好時光,我新增了一個MT的模版,多了一個專門收集站上迴響的RSS,如果你有在用RSS reader,你可以把這個RSS加入,這樣一來,當站上的文章有新的迴響時,你就會知道。

對於其他使用MT的使用者們,可以自行新增一個模板,內容如下:


<?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=”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>zh-tw</dc:language>
<dc:creator></dc:creator>
<dc:date><MTEntries lastn=”1″><$MTEntryDate format=”%Y-%m-%dT%H:%M:%S” language=”zh-tw”$><$MTBlogTimezone$></MTEntries></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”>
<rdf:li rdf:resource=”<$MTCGIPath$>mt-comments.cgi?entry_id=<$MTCommentEntryID$>#comment<$MTCommentID pad=”1″$>” />
</MTComments></rdf:Seq>
</items>

</channel>

<MTComments lastn=”15″ sort_order=”descend”>
<item rdf:about=”<$MTCGIPath$>mt-comments.cgi?entry_id=<$MTCommentEntryID$>#comment<$MTCommentID pad=”1″$>”>
<MTCommentEntry><title>Re: <$MTEntryTitle encode_xml=”1″$></title>
<link><$MTCGIPath$>mt-comments.cgi?entry_id=<$MTCommentEntryID$>#comment<$MTCommentID pad=”1″$></link>
<description><$MTCommentBody encode_xml=”1″$></description>
<dc:subject><$MTEntryCategory encode_xml=”1″$></dc:subject></MTCommentEntry>
<dc:creator><$MTCommentAuthor encode_xml=”1″$></dc:creator>
<dc:date><$MTCommentDate format=”%Y-%m-%dT%H:%M:%S” language=”zh-tw”$><$MTBlogTimezone$></dc:date>
</item>

</MTComments>

</rdf:RDF>

這個模版做出來的RSS我有在RSS Validator測試過,正常。內文的部份用我自己的火車時刻表測過,也正常。
如果有問題的話,歡迎告訴我,我會修正。

發表迴響

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料