mt - Adds support for the MovableType XML-RPC API
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; }
Adds support for the MovableType XML-RPC API
Returns an array ref of hash references.
Valid arguments are
postid
String. Required.
Returns an array ref of hash references
Valid argument are
String. Required
categories
Array ref. Required.
The MT docs state that :
The array categories is an array of structs containing
categoryId
String.
isPrimary
Using isPrimary to set the primary category is optional--in the absence of this flag, the first struct in the array will be assigned the primary category for the post
Returns true or false
Returns an array reference of hash references who keys are :
pingTitle
pingURL
pingIP
Returns an array reference.
0.2
June 27, 2002
Aaron Straup Cope
Net::Blogger::Engine::Base
http://www.movabletype.org/mt-static/docs/mtmanual_programmatic.html#xmlrpc%20api
Copyright (c) 2002, Aaron Straup Cope. All Rights Reserved.
This is free software, you may use it and distribute it under the same terms as Perl itself.
To install Net::Blogger, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Blogger
CPAN shell
perl -MCPAN -e shell install Net::Blogger
For more information on module installation, please visit the detailed CPAN module installation guide.