Main Topics
Browse All TopicsHello,
when I run the following script I get:
failed: Bad file descriptor
I need a working script. (Check if your solution works on walduma.blogspot.com - the user name and password in the following script are valid.)
Perhaps you knwo how to post a link with this script.
Thank you for your hints and answers!
--------------------------
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use XMLRPC::Lite;
my $username = "wald1999";
my $password = "wald1999x";
my $blogid = "1";
my $proxyurl = 'http://plant.blogger.com/
my $appkey = "123FCCCCD"; # the value of this is not important, it's just an ID for your script
my $msg = "Hello, my first post with this...";
my $res = XMLRPC::Lite
-> proxy($proxyurl)
-> call('blogger.newPost', $appkey, $blogid, $username, $password, $msg, 'true')
-> result;
if (defined ($res)) {
print "--success--\n";
print Dumper ($res);
} else {
print "failed: $!";
}
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Here's a little bit of help:
use Carp;
my $res = XMLRPC::Lite
-> proxy($proxyurl)
-> on_fault( sub {
my ($soap, $res) = @_;
carp( "XMLRPC Error:\n",
ref($res) ? ("\tfaultcode: ", $res->faultcode, "\n",
"\tfaultstring: ", $res->faultstring, "\n",
"\tfaultdetail: ", $res->faultdetail, "\n",
)
: ("\ttransport status: ", $soap->transport->status, "\n",)
);
return 0;
} )
-> call('blogger.newPost', $appkey, $blogid, $username, $password, $msg, 'true')
-> result;
Which gives me this output:
XMLRPC Error:
faultcode: 0
faultstring: com.google.blogger.api.Mal
faultdetail:
at /usr/local/share/perl/5.8.
failed: $! = No such file or directory; $@ =
Now, we could try and work around that, but I really don't feel like figuring out all the details when someone else has already gone through all the trouble and released a working interface on CPAN.
As far as I can tell you don't need to actually install it, since it's just a bunch of perl modules (in other words, it doesn't require compilation of binary parts). You can simply download the Net::Blogger distro, unpack it with winzip, and upload the lib directory to a location relative to your script. Then add a "use lib '/path/to/your/script/dir/
And here's a quick stab at it. Note that I unpacked the Net-Blogger-0.87.tar.gz file in the current directory.
#!/usr/bin/perl
use strict;
use warnings;
use lib 'Net-Blogger-0.87/lib';
use Carp;
my $username = "wald1999";
my $password = "wald1999x";
my $blogid = "1";
my $proxyurl = 'http://plant.blogger.com/
my $appkey = "123FCCCCD"; # the value of this is not important, it's just an ID for your script
use Net::Blogger;
my $b = Net::Blogger->new(appkey=>
$b->BlogId($blogid);
$b->Username($username);
$b->Password($password);
my $msg = "Hello, my first post with this...";
my $postid = $b->newPost(postbody=>\$ms
print "post id = $postid\n";
Which prints (unfortunately):
Fatal client error.
com.google.blogger.api.Use
I get the error "500 Can't connect to plant.blogger.com:80 (connect: Unknown error)" with my script and your last posted script. I will try it tomorrow again.
> com.google.blogger.api.Use
> or you don't have permission to access this Blog. at Net-Blogger-0.87/lib/Net/B
The username and password are correct. I have checked it.
Business Accounts
Answer for Membership
by: KannPosted on 2005-10-21 at 02:10:50ID: 15130868
Here is the link to blogger.com API docs: chives/ato m-docs.htm l#create-p ost
http://code.blogger.com/ar