MetaWeblog API全网文章批量同步发布插件简介
特不靠谱 2020-06-16 09:59:17 1183人已围观
MetaWeblog API中文说明
1、什么是MetaWeblog?
MetaWebBlog API(MWA)是一个Blog程序接口标准,允许外部程序来获取或者设置Blog的文字和熟悉。他建立在XMLRPC接口之上,并且已经有了很多的实现。
2、基本的函数规范
有三个基本的函数规范:
metaWeblog.newPost (blogid, username, password, struct, publish) 返回一个字符串,可能是Blog的ID。
metaWeblog.editPost (postid, username, password, struct, publish) 返回一个Boolean值,代表是否修改成功。
metaWeblog.getPost (postid, username, password) 返回一个Struct。
其中blogid、username、password分别代表Blog的id(注释:如果你有两个Blog,blogid指定你需要编辑的blog)、用户名和密码。
struct的含意:
在newPost和editPost中,struct是一个RSS 2.0规范中里面的定义。的定义如下:
| 元素 | 说明 | 例子 |
| title | The title of the item. | Venice Film Festival Tries to Quit Sinking |
| link | The URL of the item. | http://nytimes.com/2004/12/07FEST.html |
| description | The item synopsis. | Some of the most heated chatter at the Venice Film Festival this week was about the way that the arrival of the stars at the Palazzo del Cinema was being staged. |
| author | Email address of the author of the item | |
| category | Includes the item in one or more categories | |
| comments | URL of a page for comments relating to the item | |
| enclosure | Describes a media object that is attached to the item | |
| guid | A string that uniquely identifies the item. | |
| pubDate | Indicates when the item was published. | |
| source | The RSS channel that the item came from. |
其中最主要的三个元素是title、link和description。如果Blog工具不支持title和link,description就是目录(Content)。category是一个数组,是这个Post所属的类别。如果类别不存在,服务器端将只处理存在的类别。
3、metaWeblog.newMediaObject
metaWeblog.newMediaObject (blogid, username, password, struct) 返回一个数组,其中blogid、username、password分别代表Blog的id(注释:如果你有两个Blog,blogid指定你需要编辑的blog)、用户名和密码。struct必须包含name, type 和bits三个元素,当然也可以包含其他元素。
name代表数据的名称,type是数据的MIME类型,譬如audio/mpeg 、image/jpeg和video/quicktime。bits是数据的base64编码形式的数据流。如果调用失败,它显示错误信息。如果调用成功,返回值是一个Struct,里面至少包含一个Url元素,代表数据的HTTP或者FTP Url。
4、metaWeblog.getCategories
metaWeblog.getCategories (blogid, username, password) 返回一个struct。返回值包含所有的Blog的类别,每一个列别包含description, htmlUrl and rssUrl。
5、metaWeblog.getRecentPosts
metaWeblog.getRecentPosts (blogid, username, password, numberOfPosts) 返回一个结构(struct)的数组(array)。每一个Struct包含getPost返回值一样的结构。numberOfPosts是返回的数量。
6、调用验证和错误显示
java调用metaWeblog api需要的jar包(https://mvnrepository.com/artifact/org.apache.xmlrpc),如下图:

常见报错信息:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/ws/commons/serialize/DOMSerializer at org.apache.xmlrpc.serializer.NodeSerializer.<clinit>(NodeSerializer.java:30) at org.apache.xmlrpc.common.TypeFactoryImpl.<clinit>(TypeFactoryImpl.java:88) at org.apache.xmlrpc.common.XmlRpcController.<init>(XmlRpcController.java:31) at org.apache.xmlrpc.client.XmlRpcClient.<init>(XmlRpcClient.java:51) at com.cyl.blog.MetaWeblogAPIDemo.getUserBlog(MetaWeblogAPIDemo.java:38) at com.cyl.blog.MetaWeblogAPIDemo.main(MetaWeblogAPIDemo.java:112) Caused by: java.lang.ClassNotFoundException: org.apache.ws.commons.serialize.DOMSerializer at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 6 more
7、可用的国内博客列表
1)、CSDN
http://write.blog.csdn.net/xmlrpc/index
2)、博客园(cnblogs)
http://space.cnblogs.com/forum/topic/8550/
3)、开源中国(oschina)
https://my.oschina.net/action/xmlrpc
参考文章:
1、https://www.cnblogs.com/ljysblog/p/12336878.html
2、https://blog.csdn.net/a13393665983/article/details/102185411

备付金存管银行是指可以为支付机构办理客户备付金的跨行收付业务,并负责对支付机构存放在所有备付金银行的客户备付金信息进行归集、核对与监督的备付金银行。(支付机构客
最近有一套生产系统的数据库CPU老是偏高,发现闲时也在40%-60%左右,感觉很不正常,决定优化一下,在这
首先需要知道什么叫一元购? 就是你支付一元后获得一个购物资格,有的叫抽