Movable Type weblogs.com ping
This document describes how to modify the Movable Type code to support the
new weblogs.com XML-RPC ping interface (http://newhome.weblogs.com/faq).
Rather than automatically checking for changes in all registered blogs (the
old behavior), weblogs.com now requires that an XML-RPC ping be sent to mark
the blog as changed. The modifications described in this document add the
XML-RPC ping functionality to Movable Type. This functionality will be
incorporated into the next release of MT, but we wanted to add support for
the feature as soon as possible.
To add support for the XML-RPC ping, you will need to modify a couple of the
Movable Type library modules, as well as uploading a new library module. Your
webserver will also need the LWP set of Perl modules installed; these
modules are not part of the core Perl installation, but they should be
installed on most webservers.
The following instructions describe how to add support for performing an
XML-RPC ping to weblogs.com whenever you save an entry, or post a new entry,
to any of the Movable Type blogs.
Note: all code additions below are relative to the lines of code in the 1.1
version of Movable Type.
-
Download the new XMLRPC.pm file from the following address:
http://www.movabletype.org/downloads/XMLRPC.pm
-
Open an FTP connection to your webserver; then open the directory where you
installed Movable Type.
-
Open the directory lib; then open the directory MT. Upload the file
XMLRPC.pm into the MT directory.
-
Also in the MT directory, open the file ConfigMgr.pm in a text editor.
After line 37, add this line:
$mgr->define('WeblogsPingURL', Default => 'http://rpc.weblogs.com/RPC2');
-
Save ConfigMgr.pm (and re-upload it to your webserver, if you downloaded it
in order to edit it).
-
Open the directory App.
-
Open the file CMS.pm in a text editor. After line 858, add these lines:
require MT::XMLRPC;
my $res = MT::XMLRPC->weblogs_ping($obj->blog_id) or
return $app->error("Your post was saved, but the weblogs.com " .
"ping failed: " . MT::XMLRPC->errstr);
-
Save CMS.pm (and re-upload it to your webserver, if you downloaded it in
order to edit it).
-
That's it! Whenever you save an entry or post a new entry to your blog, a
ping will be sent to weblogs.com.
-
If Movable Type receives an error when sending the ping, the error message
will be displayed for you. However, note that in some cases, even if an error
is not displayed, your blog may still not be moved to the top of the updated
list: weblogs.com does not accept pings more frequently than five (5) minutes
apart, and this does not show up as an error in the XML-RPC response. Note
also that if your weblog has not changed, your weblog will not be marked as
updated.
-
Because of the additional overhead of making an XML-RPC request to ping
weblogs.com, saving an entry will be a little slower than it was before. If
you don't want this slowdown, then don't make the above modifications; when
this feature is incorporated into the next release, there will be a
configuration option to turn it on or off.
Copyright © 2001 Ben Trott and Mena Trott. All Rights Reserved.