DisqusコメントにインポートするためのWXRテンプレートサンプル
DISQUSコメントのインポート機能へ送信してインポートするためのWXRファイルのテンプレートです。
注意事項
- 存在する記事すべてを対象としてエクスポートします
- WXRのヴァージョンは1.1で、WordPress 3.3.1で運用しているブログからエクスポートしたファイルを元に構成したものです
- DISQUSのコメントインポート機能のみ動作を確認してありますが、その他の(このテンプレートおよび出力されたファイルの)利用については検証していません
- 具体的な使い方はこのページでは解説しません
- テンプレートタグについての質問なども受け付けていませんので、ある程度MTタグに精通されている方向けです
- 記載のテンプレートのコードは、将来的に変更になる可能性あるいは無効と成る可能性がございます
- このテンプレートの使用によりおこった損害については当方では責任をおわないこととします。
テンプレート
<?xml version="1.0" encoding="<$mt:PublishCharset$>"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wp="http://wordpress.org/export/1.1/" > <channel> <title><$mt:BlogName remove_html="1" encode_xml="1"$></title> <link><$mt:BlogURL encode_xml="1"$></link> <description><$mt:BlogDescription remove_html="1" encode_xml="1"$></description> <pubDate><mt:Entries sort_by="modified_on" limit="1"><$mt:EntryModifiedDate utc="1" language="en" format="%a, %d %b %Y %H:%M:%S +0000"$></mt:Entries></pubDate> <language><$mt:BlogLanguage ietf="1"$></language> <wp:wxr_version>1.1</wp:wxr_version> <wp:base_site_url>http://<$mt:blogHost exclude_port="1" encode_xml="1"$>/</wp:base_site_url> <wp:base_blog_url><$mt:BlogURL encode_xml="1"$></wp:base_blog_url> <generator>http://www.sixapart.com/movabletype/"><$mt:ProductName version="1"$></generator> <$mt:BlogEntryCount setvar="count"$> <mt:Entries lastn="$count" sort_order="ascend"> <item> <title><$mt:EntryTitle remove_html="1" encode_xml="1"$></title> <link><$mt:EntryPermalink encode_xml="1"$></link> <pubDate><$mt:EntryDate utc="1" language="en" format="%a, %d %b %Y %H:%M:%S +0000"$></pubDate> <dc:creator><mt:If tag="EntryAuthorDisplayName"><$MTEntryAuthorDisplayName$><mt:Else><$MTEntryAuthorUsername$></mt:If></dc:creator> <guid isPermaLink="false"><$mt:EntryAtomID$></guid> <description><mt:EntryExcerpt remove_html="1" encode_xml="1"></description> <content:encoded><mt:EntryBody encode_xml="1"> <mt:EntryMore encode_xml="1"></content:encoded> <wp:post_id><$MTEntryID$></wp:post_id> <wp:post_date><$mt:EntryDate format="%Y-%m-%d %H:%M:%S"$></wp:post_date> <wp:post_date_gmt><$mt:EntryDate utc="1" format="%Y-%m-%d %H:%M:%S"$></wp:post_date_gmt> <wp:comment_status><MTIfCommentsActive>open<mt:Else>closed</MTIfCommentsActive></wp:comment_status> <wp:ping_status><MTIfPingsActive>open<mt:Else>closed</MTIfPingsActive></wp:ping_status> <wp:post_name><mt:EntryBasename></wp:post_name> <wp:status>publish</wp:status> <wp:post_parent>0</wp:post_parent> <wp:menu_order>0</wp:menu_order> <wp:post_type><mt:If tag="EntryClass" eq="page">page<mt:Else>post</mt:If></wp:post_type> <mt:entryCategories> <category domain="category" nicename="<mt:CategoryBasename>"><mt:CategoryLabel encode_xml="1"></category></mt:entryCategories> <MTEntryIfTagged><mt:EntryTags> <category domain="post_tag" nicename="<$MTTagName encode_url="1"$>"><$MTTagName$></category></mt:EntryTags></MTEntryIfTagged> <mt:Comments> <wp:comment> <wp:comment_id><mt:CommentID></wp:comment_id> <wp:comment_author><mt:CommentAuthor default="匿名" encode_xml="1"></wp:comment_author> <wp:comment_author_email><mt:CommentEmail></wp:comment_author_email> <wp:comment_author_url><mt:CommentURL></wp:comment_author_url> <wp:comment_author_IP><mt:CommentIP></wp:comment_author_IP> <wp:comment_date><$mt:CommentDate format="%Y-%m-%d %H:%M:%S"$></wp:comment_date> <wp:comment_date_gmt><$mt:CommentDate utc="1" format="%Y-%m-%d %H:%M:%S"$></wp:comment_date_gmt> <wp:comment_content><mt:CommentBody encode_xml="1"></wp:comment_content> <wp:comment_approved>1</wp:comment_approved> <wp:comment_type></wp:comment_type> <wp:comment_parent><mt:CommentParentID _default="0"></wp:comment_parent> <mt:if tag="CommenterID"><wp:comment_user_id><mt:CommenterID></wp:comment_user_id></mt:if> </wp:comment> </mt:Comments> </item></mt:Entries> </channel> </rss>
追記:<mt:If tag="EntryClass" eq="page">
の条件式で、日本語環境の場合に<mt:If tag="EntryClass" eq=ウェブページ
とする必要がある場合があるので、注意してください(多くの場合はウェブページで積極的なコメントがつくことは少ないかコメントを閉じるケースもあるので問題とは思っていません)。
Trackbacks:1
- TrackBack URL for this entry
- https://www.markdiary.com/mt/app-pingback.cgi/72
- Listed below are links to weblogs that reference
- DisqusコメントにインポートするためのWXRテンプレートサンプル from maRk lab
DISQUSへコメントのインポートが完了した from maRkのMyOwn
DISQUSのインポートツールによるMovableTypeからのコメントのインポートが完了しましたので手順メモです。