Can't post with Perl's Net::Blogger

Posted by Ovid on Stack Overflow See other posts from Stack Overflow or by Ovid
Published on 2010-05-31T10:50:20Z Indexed on 2010/05/31 10:53 UTC
Read the original article Hit count: 216

Filed under:
|

I'm trying to automatically post to blogger using Perl's Net::Blogger but it keeps returning false and not posting. The main portion of my code looks like this:

use Net::Blogger;

my $blogger = Net::Blogger->new({
    debug    => 1,
    appkey   => '0123456789ABCDEF', # doesn't matter?
    blogid   => $blogid,
    username => $username,
    password => $password,
});

say 'got to here';
my $result = $blogger->newPost({
    postbody => \'<p>This is text</p><hr/><p><strong>Whee!</strong></p>',
    publish  => 1,
});
say 'done posting';
use Data::Dumper;
print Dumper($result);

Sure enough, $result is 0 and in checking the blog, nothing has been posted. The error I'm getting when I enable debugging is:

Element '' can't be allowed in valid XML message. 
Died. at /Library/Perl/5.10.1/SOAP/Lite.pm line 1410.

What am I doing wrong?

If you can suggest an alternative to Net::Blogger, that would be fine.

© Stack Overflow or respective owner

Related posts about perl

Related posts about netblogger