Movable Type Import Format

Movable Type Import Format


NAME

mtimport - Movable Type Import Format


SYNOPSIS

This document describes the format required by the Movable Type import mechanism, which can be used to import entries and comments from other content management systems.


DESCRIPTION

The basic import format is a list of entries, separated by the string -------- (that is eight - characters, followed by a carriage return). Each entry can be broken into two main sections; these sections are separated by the string ----- (that is five - characters, followed by a carriage return).

If you have HTML in the data that you are importing, it should not be encoded into HTML entities; the data that is in your import file is imported verbatim into the Movable Type database. Thus, your data should look exactly as it would were you to type it into the form when creating a new entry.

  • Metadata
  • Multi-line fields (Body, Extended Body, Excerpt, Comments)

See EXAMPLE, below, for an example of a small import file.

Metadata

Each piece of metadata is formatted as KEY: VALUE, and one piece of metadata is separated from the next by a carriage return. The order of the metadata pieces is not important.

For example:

AUTHOR: Foo Bar TITLE: A dummy title DATE: 01/31/2002 03:31:05 PM CATEGORY: News
  • AUTHOR
    The author of the entry.

    If the author name does not exist, a new MT::Author record will be created, and the author will be assigned posting permissions to the weblog into which you're importing the entries. The entry will then be assigned to the new author. If the author name does exist, the entry will be assigned to the existing author.

    This is ignored if you have checked the Import entries as me checkbox before importing; it is required otherwise.

  • TITLE
    The title of the entry.

    If you do not specify a title, a title will be generated automatically from the first five (5) words in the entry body.

    This is optional.

  • DATE
    The authored-on date of the entry.

    This should be in the format MM/DD/YYYY hh:mm:ss AM|PM. AM|PM is optional, and if not present the hh will be intrepreted as being in military time.

    This is required.

  • PRIMARY CATEGORY
    The primary category to which the entry is assigned.

    If the category name does not exist, a new MT::Category record will be created, and the entry will be assigned to the new category. If the category name does exist, the entry will be assigned to the existing category.

  • CATEGORY
    A secondary category to which the entry is assigned. Multiple CATEGORY keys can appear in the metadata section; each specifies a secondary category. For example:
    CATEGORY: Foo CATEGORY: Bar

    If the category name does not exist, a new MT::Category record will be created, and the entry will be assigned to the new category. If the category name does exist, the entry will be assigned to the existing category.

    If the category specified in PRIMARY CATEGORY is also listed as a CATEGORY, it will be dropped from the list of secondary categories automatically, and will be set as the primary category.

    If you do not provide a PRIMARY CATEGORY, but you do provide one or more secondary categories via CATEGORY, the first CATEGORY will be used as a primary category rather than as a category.

  • STATUS
    The post status of the entry. Valid values are either draft or publish.
  • ALLOW COMMENTS
    The value for the ``allow comments'' flag for the entry. Valid values are either 0 or 1.
  • ALLOW PINGS
    The value for the ``allow pings'' flag for the entry. Valid values are either 0 or 1.
  • CONVERT BREAKS
    The value for the ``convert breaks'' flag for the entry. Valid values are either 0 or 1.
  • NO ENTRY
    A special key used when importing data from a system where you have already imported all of the entries, but not the comments. If you use this, the DATE key is required, and will be used to look up the entries with which the comments are associated; if a matching entry cannot be found by matching the timestamps, the comments will be skipped. You probably don't need to use this.

    Example usage:

    NO ENTRY: 1

Multi-line fields

Multi-line fields are separated by ----- (that is five - characters, followed by a carriage return). Each multi-line field is started by the key denoting the type of field, followed by a carriage return, followed by the actual body of the field.

For example:

BODY: This is the body. ----- EXTENDED BODY: Here is some more text. ----- COMMENT: AUTHOR: Foo DATE: 01/31/2002 15:47:06 This is the body of this comment. ----- PING: TITLE: Foo Bar URL: http://www.foo.com/baz/archives/000015.html DATE: 08/05/2002 04:05:23 PM This is the excerpt of the ping. -----
  • BODY
    The body of the entry.
  • EXTENDED BODY
    The extended body of the entry.
  • EXCERPT
    The excerpt of the entry.
  • COMMENT
    Represents one comment on this entry. Multiple COMMENT sections can appear, each separated by the standard multi-line field separator (----- ).

    In a COMMENT section, the following fields are applicable:

    • AUTHOR
      The name of the author of the comment.
    • EMAIL
      The email address of the author of the comment.
    • URL
      The URL of the author of the comment.
    • IP
      The IP Address of the author of the comment.
    • DATE
      The date on which the comment was posted. This should be in the same format as the DATA metadata key, above.

    Any line that does not match one of the above keys starts the body of the comment; the body of the comment then consists of everything from that point to the end of the COMMENT section. If this is unclear, look below at the EXAMPLE.

  • PING
    Represents one TrackBack ping on this entry. Multiple PING sections can appear, each separated by the standard multi-line field separator (----- ).

    In a PING section, the following fields are applicable:

    • TITLE
      The title of this ping.
    • URL
      The URL to the original entry.
    • IP
      The IP address of the server that sent the ping.
    • BLOG NAME
      The name of the weblog from which the ping was sent.
    • DATE
      The date on which the ping was sent. This should be in the same format as the DATA metadata key, above.

    Any line that does not match one of the above keys starts the ping excerpt; the excerpt then consists of everything from that point to the end of the PING section. If this is unclear, look below at the EXAMPLE.


EXAMPLE

TITLE: A dummy title AUTHOR: Foo Bar DATE: 01/31/2002 03:31:05 PM PRIMARY CATEGORY: Media CATEGORY: News ----- BODY: This is the body. ----- EXTENDED BODY: Here is some more text. ----- COMMENT: AUTHOR: Foo DATE: 01/31/2002 15:47:06 This is the body of this comment. ----- COMMENT: AUTHOR: Bar DATE: 02/01/2002 04:02:07 AM IP: 205.66.1.32 EMAIL: me@bar.com This is the body of another comment. It goes up to here. ----- PING: TITLE: My Entry URL: http://www.foo.com/old/2002/08/ IP: 206.22.1.53 BLOG NAME: My Weblog DATE: 08/05/2002 16:09:12 This is the start of my entry, and here it... ----- -------- TITLE: Here is a new entry AUTHOR: Baz Quux DATE: 01/31/2002 03:31:05 CATEGORY: Politics ----- BODY: This is the body of the second entry. It can consist of multiple lines. ----- EXCERPT: See, this entry does not have an extended piece; but it does have an excerpt. It is special. ----- COMMENT: AUTHOR: Quux URL: http://www.quux.com/ DATE: 01/31/2002 04:23:01 PM Here is the first comment on this entry. ----- --------

Copyright © 2001-2005 Six Apart. All Rights Reserved.
引用通告地址: 点击获取引用地址
评论: 4 | 引用: 0 | 阅读: 5178
  • 1 
Harry Zhang [ 2006-09-01 08:16 网址 | 回复 | 编辑 删除 ]
准备给f2blog写一个汇出Movable Type格式的工具,这样数据也可以共享了。
  • 1 
发表评论
昵 称: 密 码:
网 址: 邮 箱:
验证码: 验证码图片 选 项:
头 像:
内 容: