xmlrpc.php

This file includes all the XML-RPC server code for LnBlog.  This encompasses both the Pingback implementation and the Blogger and MetaWeblog API implementations.

Summary
xmlrpc.phpThis file includes all the XML-RPC server code for LnBlog.
PingbackThis section implements Pingback for LnBlog, as described by the Pingback specification at http://hixie.ch/specs/pingback/pingback.
Functions
pingback.pingThis method receives a ping from a remote host.
pingback.extensions.getPingbacksGets a list of pingbacks on a page.
Blogger 1.0 API SupportThis section implements the Blogger 1.0 API for posting to your blog via XML-RPC.
OverviewBlogger 1.0 is an old (as blogging APIs go) and widely supported API for use with weblog clients.
Using the API with LnBlogIt is important to note that the Blogger 1.0 API is not generic.
ConfigurationWhen configuring your blogging client to use Blogger 1.0 with LnBlog, give the URL of your LnBlog/xmlrpc.php file as the address to handle the requests.
Functions
blogger.newPostAdds a new post to the blog.
blogger.editPostEdit an existing post.
blogger.deletePostDeletes the specified post.
blogger.getUsersBlogsGets a list of all blogs that a given user can add posts to.
blogger.getUserInfoGets the information for the given user.
blogger.getTemplateGets the template used for the main or entry page.
blogger.setTemplateSets the template used for the main or entry page.
MetaWeblog API SupportThe MetaWeblog API is a blogging interface that includes support for various types of blog metadata.
ConfigurationThe configuration for the MetaWeblog API is exactly the same as for the Blogger API.
API ExtensionsLnBlog’s implementation conservatively extends the MetaWeblog API.
Functions
metaWeblog.newPostCreates a new post.
metaWeblog.editPostChange an existing post.
metaWeblog.getPostGet information for an existing post
metaWeblog.newMediaObjectUploads a file to the weblog over XML-RPC.
metaWeblog.getCategoriesGets a list of categories associated with a given blog.
metaWeblog.getRecentPostsGets a list of the most recent posts to a blog.
MetaWeblog Blogger compatibility.The following MetaWeblog methods mirror the Blogger methods of the corresponding name.
Functions
metaWeblog.deletePostA MetaWeblog alias of blogger.deletePost.
metaWeblog.getTemplateA MetaWeblog alias of blogger.getTemplate.
metaWeblog.setTemplateA MetaWeblog alias of blogger.setTemplate.
metaWeblog.getUsersBlogsA MetaWeblog alias of blogger.getUsersBlogs.
MoveableType APIThe following methods are from the MovableType XML-RPC API.
Functions
mt.getRecentPostTitlesGets a stripped-down version of the recent posts list.
mt.getCategoryListGets a list of the category IDs and names for this blog.
mt.getPostCategoriesGets a list of the category IDs and names for this blog.
mt.setPostCategoriesGets a list of the category IDs and names for this blog.
mt.supportedMethodsA zero-parameter call that gets a list of the methods the server supports.
mt.supportedTextFiltersGets a list text filtering plugins supported by the server.
mt.getTrackbackPingsGets the Trackback pings for a particular entry.
mt.publishPostRebuilds all static files for a particular post.

Pingback

This section implements Pingback for LnBlog, as described by the Pingback specification at http://hixie.ch/specs/pingback/pingback.

Pingback is similar to Trackback in that it is a mechanism for one blog to notify another when the first blog links to it.  However, Pingback uses XML-RPC to send pings rather than HTTP POSTs.  Additionally, the Pingback enables auto-discovery of pingable resources using HTTP headers and HTML link elements, as opposed to the embedded RDF code used by Trackback.

The XML-RPC interface for Pingback consists of a single pingback.ping method which is used to send a ping.  In addition, LnBlog implements the suggested pingback.extensions.getPingbacks method used to syndicate pingbacks.

Summary
Functions
pingback.pingThis method receives a ping from a remote host.
pingback.extensions.getPingbacksGets a list of pingbacks on a page.

Functions

pingback.ping

This method receives a ping from a remote host.  It maps the target URL to a blog object, validates the source URL, and stores the ping if appropriate.

Parameters

sourceuriThe URI of the page doing the pinging.
targeturiThe URI of the page being pinged.

Returns

On success, the URL to the stored pingback.

pingback.extensions.getPingbacks

Gets a list of pingbacks on a page.

Parameters

urlThe URL of the page in question.

Returns

An array of URLs, one for each pingback registered for the target.

Blogger 1.0 API Support

This section implements the Blogger 1.0 API for posting to your blog via XML-RPC.

Summary
OverviewBlogger 1.0 is an old (as blogging APIs go) and widely supported API for use with weblog clients.
Using the API with LnBlogIt is important to note that the Blogger 1.0 API is not generic.
ConfigurationWhen configuring your blogging client to use Blogger 1.0 with LnBlog, give the URL of your LnBlog/xmlrpc.php file as the address to handle the requests.
Functions
blogger.newPostAdds a new post to the blog.
blogger.editPostEdit an existing post.
blogger.deletePostDeletes the specified post.
blogger.getUsersBlogsGets a list of all blogs that a given user can add posts to.
blogger.getUserInfoGets the information for the given user.
blogger.getTemplateGets the template used for the main or entry page.
blogger.setTemplateSets the template used for the main or entry page.

Overview

Blogger 1.0 is an old (as blogging APIs go) and widely supported API for use with weblog clients.  It allows you to add and edit blog posts as well as set and retreive certain information about your blog.  Support for this API was added to LnBlog in version 0.7.0 beta 1.

The Blogger 1.0 API has six methods, listed below.

blogger.newPostCreate a new blog entry.
blogger.editPostModify the contents of an existing entry.
blogger.getUsersBlogsGet the blogs for a particular user.
blogger.getUserInfoGet the user information for a particular user.
blogger.getTemplateGet the template used for the blog.
blogger.setTemplateSet the template used for the blog.

Using the API with LnBlog

It is important to note that the Blogger 1.0 API is not generic.  That is, it was designed specifically to work with Blogger and not for use by every weblog system on the face of the Earth.  As a result, not all the methods work in exactly the same way as with Blogger.  In particular, the getTemplate and setTemplate are simply not applicable to the way LnBlog works, and so they are not implemented.

In addition, the newPost and editPost methods do not include any metadata, and therefore do not accomodate setting a subject or topics for the entry.  To remedy this, LnBlog allows you to (optionally) start your post with subject and tag lines, as indicated in the sample post data below.

Subject: Hey, it's a subject!
Tags: General,Test
This is the body of the post.  The above two lines will be
stripped out of the post body and converted into the subject
and tags for this post.

Lastly, it should be noted that the API does not include a concept of input mode, i.e. there is no facility to set HTML, BBCode, or simple text input.  Therefore, LnBlog will assume that all posts made with API calls use the default markup mode for the current blog.

Configuration

When configuring your blogging client to use Blogger 1.0 with LnBlog, give the URL of your LnBlog/xmlrpc.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 blogger 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/entries/2006/05/04/03_2100/

then the post ID would be

myblog/entries/2006/05/04/03_2100/

Note that, for blogs that are hosted on a subdomain, the subdomain leads the ID.  So if your entry is located in a blog at

http://myblog.mysite.com/entries/2006/05/04/03_2100/

then your post ID will be exactly the same as above.

Functions

blogger.newPost

Adds a new post to the blog.

Parameters

appkey(string)No longer used.  Pass a dumby value.
blogid(string)Identifier for the blog.
username(string)Username to log in as.
password(string)The password to log in with.
content(string)The body text of the post.
publish(boolean)Whether or not to immediately publish the entry.  If set to false, the entry will be saved as a draft.

Returns

A string representation of the unique ID of this post.

blogger.editPost

Edit an existing post.

Parameters

appkey(string)No longer used.  Pass a dumby value.
postid(string)Identifier for the post.
username(string)Username to log in as.
password(string)The password to log in with.
content(string)The new body text of the post.
publish(boolean)Whether or not to immediately publish the entry.  The parameter is not currently used by LnBlog.

Returns

True on success.  On failure, a fault is raised.

blogger.deletePost

Deletes the specified post.

Parameters

appkey(string)No longer used.  Pass a dumby value.
postid(string)Identifier for the post.
username(string)Username to log in as.
password(string)The password to log in with.
publish(boolean)Whether or not to immediately publish the change.  The parameter is not currently used by LnBlog.

blogger.getUsersBlogs

Gets a list of all blogs that a given user can add posts to.

Parameters

appkey(string)No longer used.  Pass a dumby value.
username(string)Username to log in as.
password(string)The password to log in with.

Returns

An array of structs containing the blog name, id, and URL.

blogger.getUserInfo

Gets the information for the given user.

Parameters

appkey(string)No longer used.  Pass a dumby value.
username(string)Username to log in as.
password(string)The password to log in with.

Returns

A struct containing user’s userid, firstname, lastname, nickname, email, and url.  Note that not all of these necessarily apply to LnBlog, and so any field that is not found will be “faked” with a reasonable value or empty.

blogger.getTemplate

Gets the template used for the main or entry page.  This doesn’t apply to LnBlog and so always returns a “not implemented” message.

Parameters

appkey(string)No longer used.  Pass a dumby value.
blogid(string)Identifier for the blog.
username(string)Username to log in as.
password(string)The password to log in with.
templateType(string)The type of template to get.

blogger.setTemplate

Sets the template used for the main or entry page.  This doesn’t apply to LnBlog and so always returns a “not implemented” message.

Parameters

appkey(string)No longer used.  Pass a dumby value.
blogid(string)Identifier for the blog.
username(string)Username to log in as.
password(string)The password to log in with.
templateType(string)The type of template to get.

MetaWeblog API Support

The 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.

metaWeblog.newPostCreates a new post.
metaWeblog.editPostEdits an existing post.
metaWeblog.getPostReturns a representation of an existing post.
metaWeblog.newMediaObjectCreates a new image, video file, etc. for the blog.
metaWeblog.getCategoriesReturns the categories known to the blog.
metaWeblog.getRecentPostsReturns a list of the most recently made posts.
Summary
ConfigurationThe configuration for the MetaWeblog API is exactly the same as for the Blogger API.
API ExtensionsLnBlog’s implementation conservatively extends the MetaWeblog API.
Functions
metaWeblog.newPostCreates a new post.
metaWeblog.editPostChange an existing post.
metaWeblog.getPostGet information for an existing post
metaWeblog.newMediaObjectUploads a file to the weblog over XML-RPC.
metaWeblog.getCategoriesGets a list of categories associated with a given blog.
metaWeblog.getRecentPostsGets a list of the most recent posts to a blog.

Configuration

The configuration for the MetaWeblog API is exactly the same as for the Blogger API.  You should use the same format for entry IDs and blog IDs as well as the same end-point URL.  The only difference is in the commands sent to the server.

API Extensions

LnBlog’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.

Functions

metaWeblog.newPost

Creates a new post.

Parameters

blogid(string)Identifier for the blog.
username(string)Username to log in as.
password(string)The password to log in with.
content(struct)A struct containing the post information.  The struct members are, in general, the same as in the RSS 2.0 items.
publish(boolean)Whether or not to immediately publish the entry.  The parameter is not currently used by LnBlog.

Returns

A string representation of the unique ID of this post.

metaWeblog.editPost

Change an existing post.

Parameters

postid(string)Identifier for the post.
username(string)Username to log in as.
password(string)The password to log in with.
content(struct)A struct containing the new post information.  The struct members are, in general, the same as in the RSS 2.0 items.
publish(boolean)Whether or not to immediately publish the entry.  The parameter is not currently used by LnBlog.

Returns

True on success, raises a fault on failure.

metaWeblog.getPost

Get information for an existing post

Parameters

postid(string)Identifier for the post.
username(string)Username to log in as.
password(string)The password to log in with.

Returns

A 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.newMediaObject

Uploads a file to the weblog over XML-RPC.  New media objects are passed as structs, with ‘name’, ‘type’, and ‘bits’ fields.  The ‘bits’ field is the base64-encoded data for the file.

Parameters

postid(string)Identifier for the post.
username(string)Username to log in as.
password(string)The password to log in with.
content(struct)A struct containing the file information.  The struct must contain a ‘name’ field for the filename, a ‘type’ field for the file MIME type (LnBlog does not currently use this), and a ‘bits’ field that contains the base64-encoded file content.  This implementation also accepts an ‘entryid’ field, which contains the unique ID of an entry to which the file will be uploaded.  This only makes sense for blogging systems like LnBlog that allow per-entry uploads.

Returns

A struct with a ‘url’ element that contains the HTTP or FTP URL to the file.

metaWeblog.getCategories

Gets a list of categories associated with a given blog.

Parameters

blogid(string)Identifier for the blog.
username(string)Username to log in as.
password(string)The password to log in with.

Returns

A struct containing one struct for each category.  The category structs must contain description, htmlUrl, and rssUrl elements.  Note that LnBlog supplies RSS as an optional plugin, so the RSS URL may be empty.

metaWeblog.getRecentPosts

Gets a list of the most recent posts to a blog.

Parameters

blogid(string)Identifier for the blog.
username(string)Username to log in as.
password(string)The password to log in with.
numberOfPosts(int)The number of posts to return.

Returns

An array of structs.  The struct contents are as in the return value of the metaWeblog.getPost method.

MetaWeblog Blogger compatibility.

The following MetaWeblog methods mirror the Blogger methods of the corresponding name.  These methods were suggested by Dave Winer in this post http://www.xmlrpc.com/stories/storyReader$2460.  However, for whatever reason, the MetaWeblog API spec was never ammended to include these.  Does that mean they don’t officially exist?  I don’t know.

Summary
Functions
metaWeblog.deletePostA MetaWeblog alias of blogger.deletePost.
metaWeblog.getTemplateA MetaWeblog alias of blogger.getTemplate.
metaWeblog.setTemplateA MetaWeblog alias of blogger.setTemplate.
metaWeblog.getUsersBlogsA MetaWeblog alias of blogger.getUsersBlogs.

Functions

metaWeblog.deletePost

A MetaWeblog alias of blogger.deletePost.

metaWeblog.getTemplate

A MetaWeblog alias of blogger.getTemplate.

metaWeblog.setTemplate

A MetaWeblog alias of blogger.setTemplate.

metaWeblog.getUsersBlogs

A MetaWeblog alias of blogger.getUsersBlogs.

MoveableType API

The following methods are from the MovableType XML-RPC API.  The reference is available at http://www.movabletype.org/mt-static/docs/mtmanual_programmatic.html.

Summary
Functions
mt.getRecentPostTitlesGets a stripped-down version of the recent posts list.
mt.getCategoryListGets a list of the category IDs and names for this blog.
mt.getPostCategoriesGets a list of the category IDs and names for this blog.
mt.setPostCategoriesGets a list of the category IDs and names for this blog.
mt.supportedMethodsA zero-parameter call that gets a list of the methods the server supports.
mt.supportedTextFiltersGets a list text filtering plugins supported by the server.
mt.getTrackbackPingsGets the Trackback pings for a particular entry.
mt.publishPostRebuilds all static files for a particular post.

Functions

mt.getRecentPostTitles

Gets a stripped-down version of the recent posts list.

mt.getCategoryList

Gets a list of the category IDs and names for this blog.

mt.getPostCategories

Gets a list of the category IDs and names for this blog.

mt.setPostCategories

Gets a list of the category IDs and names for this blog.

mt.supportedMethods

A zero-parameter call that gets a list of the methods the server supports.

Returns

An array of all supported method names.

mt.supportedTextFilters

Gets a list text filtering plugins supported by the server.  As LnBlog does not currently support this concept, this just returns an empty array.

Returns

An array of structs, with a key and a label field.

mt.getTrackbackPings

Gets the Trackback pings for a particular entry.

Parameters

postidThe identifier for this post.

Returns

An array of structs, each with a pingTitle, pingURL, and pingIP.

mt.publishPost

Rebuilds all static files for a particular post.  Since LnBlog is currently all-dynamic and does not yet have unpublished posts, this method always returns true.

Parameters

postidThe ID of the post to edit.
usernameThe username with which to log in.
passwordThe associated password.

Returns

True on success, a fault on failure.

The page for the main administration menu.
Creates a new post.
Get information for an existing post
Close