metaWeblog API的一些介绍

终于可以让windows live writer的关键字支持PJBLOG了,或许很多人还不了解XMLRPC的一些接口和函数!

下面是关于metaWeblog API里面的metaWeblog.newPost一些介绍

metaWeblog.newPost

Creates a new post, and optionally publishes it. If the post is successful, this method will return the ID assigned to the post by the publishing system. Otherwise, it will return a fault.

Parameters (参数)
  • String blogid
  • String username
  • String password
  • struct content
  • boolean publish
Notes

The struct content can contain the following standard keys:

  • title, for the title of the entry;
  • description, for the body of the entry;
  • dateCreated, to set the created-on date of the entry;

In addition, Movable Type’s implementation allows you to pass in values for five other keys:

  • int mt_allow_comments, the value for the allow_comments field;
  • int mt_allow_pings, the value for the allow_pings field;
  • String mt_convert_breaks, the value for the convert_breaks field;
  • String mt_text_more, the value for the additional entry text;
  • String mt_excerpt, the value for the excerpt field;
  • String mt_keywords, the value for the keywords field;
  • array mt_tb_ping_urls, the list of TrackBack ping URLs for this entry;

If specified, dateCreated should be in ISO.8601 format.

Sample Request
1    <?xml version="1.0" encoding="UTF-8"?> 
2    <methodCall> 
3    <methodName>metaWeblog.newPost</methodName> 
4      <params> 
5        <param> 
6          <value><int>178663</int></value> 
7        </param> 
8        <param> 
9          <value><string>your_username</string></value> 
10        </param> 
11        <param> 
12          <value><string>your_password</string></value> 
13        </param> 
14        <param> 
15          <value><string>This is a post</string></value> 
16        </param> 
17        <param> 
18          <value><int>1</int></value> 
19        </param> 
20      </params> 
21    </methodCall> 

Sample Response

1    <?xml version="1.0" encoding="UTF-8"?> 
2    <methodResponse> 
3      <params> 
4        <param> 
5          <value> 
6            <string>7793094</string> 
7          </value> 
8        </param> 
9      </params> 
10    </methodResponse> 



[本日志由 admin 于 2008-07-25 11:06 PM 编辑]
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: xmlrpc
评论: 0 | 引用: 0 | 查看次数: -
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.