程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> .NET網頁編程 >> .NET實例教程 >> MetaWeblog API中文說明

MetaWeblog API中文說明

編輯:.NET實例教程
導讀:
  最近用了下MicroSoft的Windows Live Writer,確實很方便。但是總不能為了用這個客戶端而放棄使用自己的blog吧,所以我找來了一些資料來研究,准備為我的blog實現這個接口。
  轉自:http://hi.baidu.com/pleasure8/blog/item/35ab26fa6324609659ee9006.Html
  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。
  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved