Using WordPress::XMLRPC Perl Module for posting to a Wordpress Blog
The CPAN documentation for this is not entirely clear. Although you can look at the source code and try to back your way out to see what the module is expecting, this should make your life easier.
Here is a quick example of how to post to a blog. The most difficult thing was adding the category. It wants an array, but you can just pass it @categories. It has to be in brackets “[ ]“.
use WordPress::XMLRPC;
my $o = WordPress::XMLRPC->new({
username => ‘your username’,
password => ‘your password’,
proxy => ‘http://www.site.com/xmlrpc.php’,
});
$content_hashref->{title} = ‘The Title for your post’;
$content_hashref->{categories} = ['Category1','Category2'];
$content_hashref->{description} = “Here you put the content of your post”;
$o->newPost($content_hashref, 1); ### 1 is for publish. I believe its 1 by default and 0 for unpublished
You can find the module on CPAN


