Unable to Post with Perl Net :: Blogger

I am trying to automatically publish a blogger using Perl Net :: Blogger , but it continues to return false and not publish. The bulk 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, }); my $result = $blogger->newPost({ postbody => \'<p>This is text</p><hr/><p><strong>Whee!</strong></p>', publish => 1, }); use Data::Dumper; print Dumper($result); 

Of course, $ result is 0, and nothing was posted when checking the blog. The error I get when turning on 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 offer an alternative to Net :: Blogger, this will be fine.

Update: if I do not enable debugging, it hangs for a long time when trying to publish.

+4
source share
3 answers

I can understand your disappointment, I don’t like it when I try to use the CPAN module, which is seductively named (that is, it looks like a good scratch for itching), but in the end it will not come in handy. However, Net :: Blogger has the latest update in 2006, so I think it would be unbelievable if it still worked initially, given that the blogger has evolved over the years.

In daxim rec, I quickly tried installing Atompub on OS X via CPAN.pm, but could not because of the tight dependency on Perl :: Critic, which would not be installed. I suppose I know how to fix this, but I need more than that to make an effort.

I saw this note in Net :: Blogger perldoc, which, if nothing else gives a hint of another module, to try, for those who did not want to beat Atompub into submission:

Atom API

In January 2004, Blogger announced their support for the Atom API.

At the time of this writing (version 0.87), this package does not support the Atom API. If you need to do Atom-ish things, it is best to use the XML :: Atom package.

+3
source

An alternative to your request: after all the various blogging APIs, a standard appeared in the form of RFC 5023.

Atompub works great.

+2
source

Today I worked a bit with Net :: Logger and was able to post on Blogger, the problem is that you can only install the body (without Atom support as virtual).

Please take a look at my Perl Posting Blogger blues post for some help.

+1
source

Source: https://habr.com/ru/post/1311404/


All Articles