Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 软件时空 > 软件相关 > 使用XML-API编辑管理我的CU-blog
【标  题】:使用XML-API编辑管理我的CU-blog
【关键字】:XML-API,CU-blog
【来  源】:http://blog.chinaunix.net/article.php?articleId=8440&blogId=1234

使用XML-API编辑管理我的CU-blog

Your Ad Here

这篇文章是使用BBuddy工具编辑和发布的。BlogBuddy为开源软件,感谢

chnwin的辛勤工作,目前下载的为中文版本。)

使用BBuddy这样的工具编辑和发布Blog是很方便的,现在也有很多这样的工具,但是他们的
原理都是使用了blog系统的xml-rpc接口。连接时需要如下参数:
  1. 你在这个blog上登陆的用户名和密码:我就是crackpotxxxxxxxx
  2. 还有这个blog登陆页面的地址和端口,CU的就是:blog.chinaunix.net,端口:80
  3. 然后还需要这个blog系统的xml-rpc所在的path,CU的blog系统是Plog,它的XML的路径
xmlrpc.php,对CU来说就是:/xmlrpc.php
这样,就可以在本地看到你的blog,同时方便的进行编辑,管理和发布。
下面是XML-API的介绍(转自 竹笋炒肉),CU的强人们完全可以自己作出一个自己的工具来。

BloggerAPI based on XML-RPC


1、方法列表
方法说明
blogger.newPost向批定的blog增加新的文章(post),通常会在增加后即发布。
blogger.editPost编辑一篇文章(post),通常会在修改后发布。
blogger.getUsersBlogs返回一个成员的所有文章的信息。
blogger.getUserInfo鉴证一个用户并反回其信息(如userid,email等)
blogger.getTemplate返回指定的blog的主要或文档索引模板
blogger.setTemplate编辑指定的blog的主要或文档索引模板

2、blogger.newPost
参数说明
参数说明
appkey (string)发送这个post的程序的唯一标志
blogid (string)这个post即将发送到的blog的标志
username (string)有权post文章的用户名
password (string)用户密码
content (string)Post的内容
publish (boolean)是否发布

示例:
请求XML-RPC调用的数据
POST /api/RPC2 HTTP/1.0
User-Agent: Java.Net Wa-Wa 2.0
Host: plant.blogger.com
Content-Type: text/xml
Content-length: 515


blogger.newPost

C6CE3FFB3174106584CBB250C0B0519BF4E294
744145
ewilliams
secret
Today I had a peanut butter and pickle sandwich
for lunch. Do you like peanut-butter and pickle sandwiches? I do.
They're yummy. Please comment!

false


成功时的应答
HTTP/1.1 200 OK
Connection: close
Content-Length: 125
Content-Type: text/xml
Date: Mon, 6 Aug 20001 19:55:08 GMT
Server: Java.Net Wa-Wa/Linux




4515151



失败时的应答
错误信息通过XML-RPC  项返回,包含着的  有错误码和描述,这是由xml-rpc规范定义. 
HTTP/1.1 200 OK
Connection: close
Content-Length: 225
Content-Type: text/xml
Date: Mon, 6 Aug 20001 19:55:08 GMT
Server: Java.Net Wa-Wa/Linux






faultCode
4


faultString
java.lang.Exception: java.lang.Exception: Error: AppKey is
invalid or inactive.







3、blogger.editPost
参数说明
参数说明
appkey (string)发送这个post的程序的唯一标志
postid (string)某篇post的唯一标志
username (string)有权修改文章的用户名(作者或管理员)
password (string)用户密码
content (string)Post的内容
publish (boolean)是否发布

4、blogger.getUserBlogs
参数说明
参数说明
appkey (string)发送这个post的程序的唯一标志
username (string)用户名
password (string)用户密码

成功应答示例

HTTP/1.1 200 OK
Connection: close
Content-Length: 125
Content-Type: text/xml
Date: Mon, 6 Aug 20001 19:55:08 GMT
Server: Java.Net Wa-Wa/Linux










url
http://stuff.foo.com/biz


blogid
2997323


blogName
Blogger Biz Dev






url
http://www.blogger.com/


blogid
2723


blogName
Blogger News





url
http://www.geocities.com/rafting/


blogid
223723


blogName
RaftingBlog











5、blogger.getUserInfo
参数说明
参数说明
appkey (string)发送这个post的程序的唯一标志
username (string)用户名
password (string)用户密码

成功应答示例
HTTP/1.1 200 OK
Connection: close
Content-Length: 125
Content-Type: text/xml
Date: Mon, 6 Aug 20001 19:55:08 GMT
Server: Java.Net Wa-Wa/Linux







nickname
Ev.


userid
1


url
http://www.evhead.com


email
ev@pyra.com


lastname
Williams


firstname
Evan







6、blogger.getTemplate
参数说明
参数说明
appkey (string)发送这个post的程序的唯一标志
blogid (string)这个post即将发送到的blog的标志
username (string)有权post文章的用户名
password (string)用户密码
templateType (string)指定返回哪个模板,目前只能是 "main" 或 "archiveIndex".

成功时的应答,....表示此处内容被我省略。
<

<$BlogDateHeaderDate$>

<$BlogItemBody$>

main


XMLRPC-EPI学习笔记1:【上一篇】
终于解决了odac的报错"Can't find ConnectForm.dcu":【下一篇】
【相关文章】
没有相关文章
【随机文章】
  • ERP选型评估要素体系分析
  • 沈阳地区计算机技术交流组织
  • linux引导
  • 在一个DataWindow中修改多个Table
  • 在网页中显示饼图、柱状图等统计图形
  • konsole小技巧
  • Windows XP系统中如何屏蔽 Ctrl+Alt+Del、Alt+Tab以及Ctrl+Esc键序列
  • Basic UNIX commands
  • 无组件上传图片到数据库中,最完整解决方案
  • 学会学习
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.