today | current | recent | random ... categories | search ... who ... syndication

Me : Net::Blogger.pm 0.7

Adds support for the metaWeblog and mt APIs to the MovableType engine. Which means you can do stuff like:



sub main {



  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));



  return 1;



}







sub fortune {



  local $/;



  undef $/;







  system ("fortune > /home/asc/tmp/fortune");







  open F, "</home/asc/tmp/fortune";



  my $fortune = <F>;



  close F;







  return $fortune;



}



We will get a common API, one of these days, by hook or by crook...

refers to

meta

 
Réjean Tremblay : "On dit ne pas aimer Patrice Brisebois ←  → Me : XML::Filter::XML_Directory_Pruner.pm 1.0