$struct = new xmlrpcval(array("url" => new xmlrpcval(url("blog/view". urlencode($user->uid))), "blogid" => new xmlrpcval($user->uid), "blogName" => new xmlrpcval($user->name . "'s blog at ". variable_get("site_name", "drupal"))),"struct");
$result = db_query_range("SELECT n.*, u.name FROM node n LEFT JOIN users u ON n.uid = u.uid WHERE n.uid = %d ORDER BY n.nid DESC", $user->uid, 0, $num);
<p><a href="http://www.blogger.com">Blogger</a>, the well-known public weblog service, provides an application programing interface (API) to allow remote procedure calls (RPC) to the Blogger service. Drupal supports this <a href="http://plant.blogger.com/api/index.html">Blogger API</a>, which means that many remote clients (e.g. <a href="radio.userland.com">Radio</a>, <a href="http://simon.kittle.info/textrouter">TextRouter</a>, <a href="http://blogbuddy.sourceforge.net/">Blogbuddy</a>, <a href="http://www.wbloggar.com/">w.bloggar</a>, <a href="http://www.tswoam.co.uk/index.php?n_go=16">PerlyBlog</a>), may post to Drupal. These clients provide a bevy of interesting capabilities like offline composing, spellcheck, and WYSIWYG editing; many folks prefer to blog with a client application over typical web forms. By supporting the Blogger API, Drupal grows grander than a web site engine, it's a <i>content accepting machine</i>™.
<p>The <a href="http://plant.blogger.com/api/index.html">Blogger RPC API</a> uses the <a href="http://www.xmlrpc.com">XML-RPC</a> protocol for communicating with the outside world. XML-RPC, originally developed by Dave Winer of <a href="http://www.userland.com">UserLand Software</a>, is a simple XML-based RPC specification ideally suited to the web. Drupal also uses XML-RPC for several other tasks (e.g. notifiying <a href="http://www.weblogs.com">weblogs.com</a> of blog updates and making/accepting <?php echo l("distributed authentication", "user/help"); ?> requests)</p>
<p>A word of warning on the Blogger API: it is unofficial. It exists because Blogger is one of the most popular services and also they were first to implement an XML-RPC interface to their service. It is certainly not the best implementation of a distributed weblog API. For a promising candidate, see <a href="http://www.wasabii.org">Wasabii</a>.</p>
<p>Drupal also supports the following methods. These methods were added after the those listed above and are not documented on the Blogger API website. Each method is linked to its corresponding blogger-dev mailing list posts:</p>
<p>To install the Blogger API module, enable the module in the <i>site configuration - modules</i> tab in the administration pages. Also make sure you have your permissions set correctly for accessing the Blogger API, the relevant settings can be found under the <i>user management</i> tab in the administration menu. Check the checkbox behind the line "access Blogger API" for the roles that are allowed to use the Blogger API.</p>
<p>Once the API is enabled you can download one of the above mentioned Blogger API clients and get blogging.</p>
<h3>Setup of the client</h3>
<p>The Drupal page you need to call in order to connect using the Blogger API is <i>http://server/xmlrpc.php</i> where <i>server</i> is the URL of the site you want to post to. When posting to drupal.org, the account settings for i.e. <a href="http://www.wbloggar.com/">w.bloggar</a> would be: host: www.drupal.org (default = plant.blogger.com) and page: xmlrpc.php (default = /api/RPC2).</p>
<p>You can't use remote authentication when posting using a Blogger API enabled client, even when you could use that to authenticate on the site itself. You will have to use the site's local username, enter a password for that account, and then use that combination to post using the Blogger API client.</p>
<li>The Blogger API does not allow for a title element. Our work around for this is either to use <title></title> tags in the body of your post or let the module create a title by inspecting the first few lines of the post body.</li>
<li>The publish parameter is always set to <i>1</i>.</li>
<li>When using the <i>getUserInfo</i> call, Drupal attempts to generate a first and last name from the Drupal username; no distinction is made internally</li>
<li><i>GetUsersBlogs</i> only returns one blog because unlike Blogger, Drupal only allows one blog per user.</li>
<p>The original Drupal Blogger API implementation was authored by <a href="http://www.voidstar.com/">Julian Bond</a>, and updated by the Drupal team.</a>