Skip Menu |

This queue is for tickets about the Net-Blogger CPAN distribution.

Report information
The Basics
Id: 15961
Status: resolved
Priority: 0/
Queue: Net-Blogger

People
Owner: claco [...] cpan.org
Requestors: claco [...] chrislaco.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.87
Fixed in: (no value)



Subject: metaWeblog.getRecentPosts broken
When requesting to use the metaWeblog api, the requests still go to the server as blogger requests: use Net::Blogger; my $api = Net::Blogger->new({ engine => 'movabletype', blogid => 5, username => 'claco', password => 'xxxxxx', debug => 1 }); $api->Proxy('http://handelframework.com/mt/mt-xmlrpc.cgi'); { $^W = 0; my ($status, @entries) = $api->metaWeblog()->getRecentPosts(); warn $status; warn scalar @entries; foreach my $entry (@entries) { foreach my $key (keys %{$entry}) { print "KEY: ", $key,"\n"; }; }; }; Using the code above, the following is the methodname send to the server: <methodName>blogger.getRecentPosts</methodName> That should be metaWeblog.getRecentPosts at that point.
From: claco [...] chrislaco.com
[CLACO - Sat Nov 19 17:21:30 2005]: Show quoted text
> When requesting to use the metaWeblog api, the requests still go to > the server as blogger requests: > > use Net::Blogger; > > my $api = Net::Blogger->new({ > engine => 'movabletype', > blogid => 5, > username => 'claco', > password => 'xxxxxx', > debug => 1 > }); > > $api->Proxy('http://handelframework.com/mt/mt-xmlrpc.cgi'); > > { > $^W = 0; > my ($status, @entries) = $api->metaWeblog()->getRecentPosts(); > > warn $status; > warn scalar @entries; > foreach my $entry (@entries) { > foreach my $key (keys %{$entry}) { > print "KEY: ", $key,"\n"; > > }; > }; > }; > > > Using the code above, the following is the methodname send to the > server: > > <methodName>blogger.getRecentPosts</methodName> > > That should be metaWeblog.getRecentPosts at that point.
OR missing really... here's the hack I used in my local files... sub Net::Blogger::Engine::Userland::metaWeblog::getRecentPosts { my $self = shift; if ($self->{'__parent'} eq "Movabletype") { $self->LastError("This method is not supported by the $self->{'__parent'} engine."); return undef; } my $call = $self->_Client()->call( "metaWeblog.getRecentPosts", $self->_Type(string=>$self->BlogId()), $self->_Type(string=>$self->Username()), $self->_Type(string=>$self->Password()), ); my @posts = ($call) ? (1,@{$call->result()}) : (0,undef); return @posts; };
Something more correct with numberOfPosts parameter... sub Net::Blogger::Engine::Userland::metaWeblog::getRecentPosts { my $self = shift; my $args = (ref($_[0]) eq "HASH") ? shift : {@_}; my $call = $self->_Client()->call( "metaWeblog.getRecentPosts", $self->_Type(string=>$self->BlogId()), $self->_Type(string=>$self->Username()), $self->_Type(string=>$self->Password()), $self->_Type(int=>$args->{'numberOfPosts'}), ); my @posts = ($call) ? (1,@{$call->result()}) : (0,undef); return @posts; };
Added my own patch. 1.01 now includes support for metaWeblog.getRecentPosts. :-)