|
NAMEmt - Adds support for the MovableType XML-RPC API SYNOPSIS use Net::Blogger;
use Carp;
use Data::Dumper;
my $mt = Net::Blogger->new(engine=>"movabletype");
$mt->Proxy("http://yaddayadda.com/mt-xmlrpc.cgi");
$mt->Username("asc");
$mt->Password("*****");
$mt->BlogId(123);
$mt->newPost(postbody=>\&fortune(),publish=>1)
|| croak $mt->LastError();
my $id = $mt->metaWeblog()->newPost(title=>"test:".time,
description=>&fortune(),
publish=>1)
|| croak $mt->LastError();
my $categories = $mt->mt()->getCategoryList()
|| croak $mt->LastError();
my $cid = $categories->[0]->{categoryId};
$mt->mt()->setPostCategories(postid=>$id,
categories=>[{categoryId=>$cid}])
|| croak $mt->LastError();
print &Dumper($mt->mt()->getPostCategories(postid=>$id));
sub fortune {
local $/;
undef $/;
system ("fortune > /home/asc/tmp/fortune");
open F, "</home/asc/tmp/fortune";
my $fortune = <F>;
close F;
return $fortune;
}
DESCRIPTIONAdds support for the MovableType XML-RPC API OBJECT METHODS$obj->getRecentPostTitles(\%args)Valid arguments are :
Returns an array ref of hash refs. Each hash ref contains the following keys :
This method was introduced in Net::Blogger 0.86 and does not accept arguments passed as a list. They must be passed by reference. $obj->getCategoryList()Returns an array ref of hash references. $obj->getPostCategories(\%args)Valid arguments are
Releases prior to Net::Blogger 0.85 accepted a list of arguments rather than a reference. Version 0.85+ are backwards compatible. Returns an array ref of hash references $obj->setPostCategories(\%args)Valid argument are
Releases prior to Net::Blogger 0.85 accepted a list of arguments rather than a reference. Version 0.85+ are backwards compatible. Returns true or false $obj->getTrackbackPings(\%args)
Returns an array reference of hash references who keys are :
Releases prior to Net::Blogger 0.85 accepted a list of arguments rather than a reference. Version 0.85+ are backwards compatible. $obj->supportMethods()Returns an array reference. $obj->publishPost($postid)Returns true or false. VERSION1.0 DATE$Date: 2005/03/26 19:29:08 $ AUTHORAaron Straup Cope SEE ALSONet::Blogger::Engine::Base http://www.movabletype.org/mt-static/docs/mtmanual_programmatic.html#xmlrpc%20api LICENSECopyright (c) 2002-2005, Aaron Straup Cope. All Rights Reserved. This is free software, you may use it and distribute it under the same terms as Perl itself.
|