metaweblog.phpThis file implements the MetaWeblog API for posting to your blog via XML-RPC. Summary
OverviewThe MetaWeblog API is a blogging interface that includes support for various types of blog metadata. This is in contrast to the Blogger 1 API, which included basic support for adding and editing entry text, but had no notion of subjects, categories, and the like. It was also heavily biased in favor of Blogger’s implementation. The MetaWeblog API is intended as a more general API to remedy this situation. Like the Blogger API, MetaWeblog functions by making XML-RPC calls. Most of the data used by the API calls takes the form of XML-RPC structs. The API contains the base methods given below. For full details, please consult the MetaWeblog API specification at http://www.xmlrpc.com/metaWeblogApi.
ConfigurationWhen configuring your blogging client to use the MetaWeblog API with LnBlog, give the URL of your LnBlog/metaweblog.php file as the address to handle the requests. You can use your normal LnBlog username and password as your login. For the blog ID, give the root-relative path to your blog. If you look on the index.php admin page, this is simply the text that shows up in the drop-down for upgrading your blog. When editing posts via the API, the post ID is simply the URL of the directory in which the post is stored, with the protocol and domain name removed. So, if your post is at http://www.mysite.com/myblog/2006/05/04/03_2100/ then the post ID would be myblog/2006/05/04/03_2100/ API ExtensionsLnBlog’s implementation conservatively extends the MetaWeblog API. In other words, the implementation remains compatible with the standard, but adds a few features that clients may, at their option, choose to use. The newMediaObject method has been extended with an optional struct field called ‘entryid’. This field takes the same entry ID used by the getPost and editPost methods. If this field is specified, then the media object will be added to that particular entry rather than to the base weblog. Note that this extension only makes sense for blog systems which can segregate files on a per-entry basis, like LnBlog. Systems that do not have such a concept should ignore this field. Summary
metaWeblog. newPostCreates a new post. Parameters
ReturnsA string representation of the unique ID of this post. metaWeblog. editPostChange an existing post. Parameters
ReturnsTrue on success, raises a fault on failure. metaWeblog. getPostGet information for an existing post Parameters
ReturnsA struct representing the post. As in the aruguments to metaWeblog.newPost, the struct contains elements corresponding to those in RSS 2.0 item elements. metaWeblog. getCategoriesGets a list of categories associated with a given blog. Parameters
ReturnsA struct containing one struct for each category. The category structs must contain description, htmlURL, and rssURL elements. Note that LnBlog currently does not have RSS URLs for categories. metaWeblog. getRecentPostsGets a list of the most recent posts to a blog. Parameters
ReturnsAn array of structs. The struct contents are as in the return value of the metaWeblog.getPost method. |