blogger.php

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

Summary
This file implements the Blogger 1.0 API for posting to your blog via XML-RPC.
Blogger 1.0 is an old (as blogging APIs go) and widely supported API for use with weblog clients.
It is important to note that the Blogger 1.0 API is not generic.
When configuring your blogging client to use Blogger 1.0 with LnBlog, give the URL of your LnBlog/blogger.php file as the address to handle the requests.
Adds a new post to the blog.
Edit an existing post.
Gets a list of all blogs that a given user can add posts to.
Gets the information for the given user.
Gets the template used for the main or entry page.
Sets 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/blogger.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/2006/05/04/03_2100/

then the post ID would be

myblog/2006/05/04/03_2100/
Summary
Adds a new post to the blog.
Edit an existing post.
Gets a list of all blogs that a given user can add posts to.
Gets the information for the given user.
Gets the template used for the main or entry page.
Sets the template used for the main or entry page.

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.  The parameter is not currently used by LnBlog.

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. 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.
The page for the main administration menu.