.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Net::Blogger 3" .TH Net::Blogger 3 "2008-01-13" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" Net::Blogger \- an OOP\-ish interface for accessing a weblog via the Blogger XML\-RPC API. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Net::Blogger; \& my $b = Net::Blogger->new(appkey=>APPKEY); .Ve .PP .Vb 3 \& $b->BlogId(BLOGID); \& $b->Username(USERNAME); \& $b->Password(PASSWORD); .Ve .PP .Vb 1 \& $b->BlogId($b->GetBlogId(blogname=>'superfoobar')); .Ve .PP .Vb 1 \& # Get recent posts .Ve .PP .Vb 1 \& my ($ok,@p) = $b->getRecentPosts(numposts=>20); .Ve .PP .Vb 3 \& if (! $ok) { \& croak $b->LastError(); \& } .Ve .PP .Vb 1 \& map { print "\et $_->{'postid'}\en"; } @p; .Ve .PP .Vb 1 \& # Post from a file .Ve .PP .Vb 1 \& my ($ok,@p) = $b->PostFromFile(file=>"/usr/blogger-test"); .Ve .PP .Vb 3 \& if (! $ok) { \& croak $b->LastError(); \& } .Ve .PP .Vb 1 \& # Deleting posts .Ve .PP .Vb 3 \& map { \& $b->deletePost(postid=>"$_") || croak $b->LastError(); \& } @p; .Ve .PP .Vb 1 \& # Getting and setting templates .Ve .PP .Vb 2 \& my $t = $b->getTemplate(type => 'main'); \& $b->setTemplate(type=>'main',template=>\e$t) || croak $b->LastError(); .Ve .PP .Vb 1 \& # New post .Ve .PP .Vb 2 \& my $txt = "hello world."; \& my $id = $b->newPost(postbody=>\e$txt) || croak $b->LastError(); .Ve .PP .Vb 1 \& # Get post .Ve .PP .Vb 2 \& my $post = $b->getPost($id) || croak $b->LastError(); \& print "Text for last post was $post->{'content'}\en"; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Blogger.pm provides an OOP-ish interface for accessing a weblog via the Blogger XML-RPC \s-1API\s0. .SH "ENGINES" .IX Header "ENGINES" Blogger.pm relies on \*(L"engines\*(R" to implement it's functionality. The Blogger.pm package itself is little more than a wrapper file that happens to use a default \*(L"Blogger\*(R" engine is none other is specified. .PP .Vb 1 \& my $manila = Net::Blogger->new(engine=>"manila"); .Ve .PP But wait!, you say. It's an \s-1API\s0 that servers implements and all I should have to do is changed the login data. Why do I need an engine? .PP Indeed. Every server pretty much gets the spirit of the \s-1API\s0 right, but each implements the details slightly differently. For example : .PP The MovableType XML-RPC server follows the spec for the \fIgetRecentPost\fR but because of the way Perl auto-vivifies hashes it turns out you can slurp all the posts for a blog rather than the just the 20 most recent. .PP The Userland Manila server doesn't support the \fIgetUsersBlogs\fR method; the Userland RadioUserland server does. .PP The Blogger server imposes a limit on the maximum length of a post. Other servers don't. (Granted the server in question will return a fault, if necessary, but Blogger.pm tries to do the right thing and check for these sorts of things before adding to the traffic on the network.) .PP Lots of weblog-like applications don't support the Blogger \s-1API\s0 but do have a traditional \&\s-1REST\s0 interface. With the introduction of Blogger.pm \*(L"engines\*(R", support for these applications via the \s-1API\s0 can be added with all the magic happening behind the curtain, so to speak. .SH "PACKAGE METHODS" .IX Header "PACKAGE METHODS" .Sh "_\|_PACKAGE_\|_\->new(\e%args)" .IX Subsection "__PACKAGE__->new(%args)" Instantiate a new Blogger object. .PP Valid arguments are : .IP "\(bu" 4 \&\fBengine\fR (required) .Sp String. Default is \*(L"blogger\*(R". .IP "\(bu" 4 \&\fBappkey\fR .Sp String. The magic appkey for connecting to the Blogger \s-1XMLRPC\s0 server. .IP "\(bu" 4 \&\fBblogid\fR .Sp String. The unique \s-1ID\s0 that Blogger uses for your weblog .IP "\(bu" 4 \&\fBusername\fR .Sp String. A valid username for blogid .IP "\(bu" 4 \&\fBpassword\fR .Sp String. A valid password for the username/blogid pair. .PP Releases prior to Net::Blogger 0.85 accepted a list of arguments rather than a reference. Version 0.85+ are backwards compatible. .PP Returns an object. Woot! .Sh "_\|_PACKAGE_\|_\->\fIinit()\fP" .IX Subsection "__PACKAGE__->init()" Initializes the specified engine .SH "Blogger API METHODS" .IX Header "Blogger API METHODS" .Sh "$pkg\->\fIgetUsersBlogs()\fP" .IX Subsection "$pkg->getUsersBlogs()" Fetch the \fIblogid\fR, \fIurl\fR and \fIblogName\fR for each of the Blogger blogs the current user is registered to. .PP Returns an array ref of hashes. .Sh "$pkg\->newPost(\e%args)" .IX Subsection "$pkg->newPost(%args)" Add a new post to the Blogger server. .PP Valid arguments are : .IP "\(bu" 4 \&\fBpostbody\fR .Sp Scalar ref. \fIrequired\fR .IP "\(bu" 4 \&\fBpublish\fR .Sp Boolean. .PP If the length of \fIpostbody\fR exceeds maximum length allowed by the Blogger servers \&\*(-- 65,536 characters \*(-- currently the text will be chunked into smaller pieces are each piece will be posted separately. .PP Returns an array containing one, or more, post ids. .Sh "$pkg\->getPost($postid)" .IX Subsection "$pkg->getPost($postid)" Returns a hash ref, containing the following keys : userid, postid, content and dateCreated. .Sh "$pkg\->getRecentPosts(\e%args)" .IX Subsection "$pkg->getRecentPosts(%args)" Fetch the latest (n) number of posts for a given blog. The most recent posts are returned first. .PP Valid arguments are .IP "\(bu" 4 \&\fBnumposts\fR .Sp Int. If no argument is passed to the method, default is 1. .Sp \&\*(L"NumberOfPosts is limited to 20 at this time. Let me know if this gets annoying. Letting this number get too high could result in some expensive db access, so I want to be careful with it.\*(R" \-\-Ev .PP Releases prior to Net::Blogger 0.85 accepted a list of arguments rather than a reference. Version 0.85+ are backwards compatible. .PP Returns true or false, followed by an array of hash refs. Each hash ref contains the following keys : postid,content,userid,dateCreated .Sh "$pkg\->editPost(\e%args)" .IX Subsection "$pkg->editPost(%args)" Update the Blogger database. Set the body of entry \f(CW$postid\fR to \f(CW$body\fR. .PP Valid arguments are : .IP "\(bu" 4 \&\fBpostbody\fR (required) .Sp Scalar ref or a valid filehandle. .IP "\(bu" 4 \&\fBpostid\fR (required) .Sp String. .IP "\(bu" 4 \&\fBpublish\fR .Sp Boolean. .PP If the length of \fIpostbody\fR exceeds maximum length allowed by the Blogger servers \&\*(-- 65,536 characters \*(-- currently the text will be chunked into smaller pieces are each piece will be posted separately. .PP Releases prior to Net::Blogger 0.85 accepted a list of arguments rather than a reference. Version 0.85+ are backwards compatible. .PP Returns an array containing one, or more, post ids. .Sh "$pkg\->deletePost(\e%args)" .IX Subsection "$pkg->deletePost(%args)" Delete a post from the Blogger server. .PP Valid arguments are .IP "\(bu" 4 \&\fBpostid\fR (required) .Sp String. .IP "\(bu" 4 \&\fBpublish\fR .Sp Boolean. .PP Releases prior to Net::Blogger 0.85 accepted a list of arguments rather than a reference. Version 0.85+ are backwards compatible. .PP Returns true or false. .Sh "$pkg\->setTemplate(\e%args)" .IX Subsection "$pkg->setTemplate(%args)" Set the body of the template matching type \fI$type\fR. .PP .Vb 3 \& "template is the HTML (XML, whatever -- Blogger can output any sort of text). \& Must contain opening and closing tags to be valid and accepted." \& --Evan .Ve .PP Valid arguments are .IP "\(bu" 4 \&\fBtemplate\fR .Sp Scalar ref. \fIrequired\fR .IP "\(bu" 4 \&\fBtype\fR .Sp String. \fIrequired\fR .Sp Valid types are \*(L"main\*(R" and \*(L"archiveIndex\*(R" .PP Releases prior to Net::Blogger 0.85 accepted a list of arguments rather than a reference. Version 0.85+ are backwards compatible. .PP Returns true or false. .Sh "$pkg\->getTemplate(\e%args)" .IX Subsection "$pkg->getTemplate(%args)" Fetch the body of the template matching type \fI$type\fR. .PP Valid types are .IP "\(bu" 4 \&\fBtype\fR .Sp String. \fIrequired\fR .Sp Valid types are \*(L"main\*(R" and \*(L"archiveIndex\*(R" .PP Releases prior to Net::Blogger 0.85 accepted a list of arguments rather than a reference. Version 0.85+ are backwards compatible. .PP Returns a string. .SH "EXTENDED METHODS" .IX Header "EXTENDED METHODS" .Sh "$pkg\->GetBlogId(\e%args)" .IX Subsection "$pkg->GetBlogId(%args)" Return the unique blogid for \fI$args\-\fR{'blogname'}>. .PP Valid arguments are .IP "\(bu" 4 \&\fBblogname\fR .Sp String. .PP Releases prior to Net::Blogger 0.85 accepted a list of arguments rather than a reference. Version 0.85+ are backwards compatible. .PP Returns a string. If no blogname is specified, the current blogid for the object is returned. .Sh "$pkg\->DeleteAllPosts(\e%args)" .IX Subsection "$pkg->DeleteAllPosts(%args)" Delete all the posts on a weblog. Valid arguments are : .IP "\(bu" 4 \&\fBpublish\fR .Sp Boolean. .PP Releases prior to Net::Blogger 0.85 accepted a list of arguments rather than a reference. Version 0.85+ are backwards compatible. .Sh "$pkg\->PostFromFile(\e%args)" .IX Subsection "$pkg->PostFromFile(%args)" Open a filehandle, and while true, post to Blogger. If the length of the amount read from the file exceeds the per-post limit assigned by the Blogger servers \*(-- currently 65,536 characters \*(-- the contents of the file will be posted in multiple \*(L"chunks\*(R". .PP Valid arguments are .IP "\(bu" 4 \&\fBfile\fR .Sp /path/to/file \fIrequired\fR .IP "\(bu" 4 \&\fBpostid\fR .Sp String. .IP "\(bu" 4 \&\fBpublish\fR .Sp Boolean. .IP "\(bu" 4 \&\fBtail\fR .Sp Boolean. .Sp If true, the method will not attempt to post data whose length exceeds the limit set by the Blogger server in the order that the data is read. Translation : last in becomes last post becomes the first thing you see on your weblog. .PP If a \fIpostid\fR argument is present, the method will call the Blogger \s-1API\s0 \fIeditPost\fR method with postid. Otherwise the method will call the Blogger \s-1API\s0 \fInewPost\fR method. .PP Releases prior to Net::Blogger 0.85 accepted a list of arguments rather than a reference. Version 0.85+ are backwards compatible. .PP Returns true or false, followed by an array of zero, or more, postids. .Sh "$pkg\->PostFromOutline(\e%args)" .IX Subsection "$pkg->PostFromOutline(%args)" Like \fIPostFromFile\fR, only this time the file is an outliner document. .PP This method uses Simon Kittle's Text::Outline::asRenderedHTML method for posting. As of this writing, the Text::Outline package has not been uploaded to the \s-1CPAN\s0. See below for a link to the homepage/source. .PP Valid outline formats are \s-1OPML\s0, tabbed text outline, Emacs' outline-mode format, and the \&\s-1GNOME\s0 Think format. .PP Valid arguments are .IP "\(bu" 4 \&\fBfile\fR .Sp /path/to/file \fIrequired\fR .IP "\(bu" 4 \&\fBpostid\fR .Sp String. .IP "\(bu" 4 \&\fBpublish\fR .Sp Boolean. .PP If a \fIpostid\fR argument is present, the method will call the Blogger \s-1API\s0 \&\fIeditPost\fR method with postid. Otherwise the method will call the Blogger \&\s-1API\s0 \fInewPost\fR method. .PP Releases prior to Net::Blogger 0.85 accepted a list of arguments rather than a reference. Version 0.85+ are backwards compatible. .PP Returns true or false, followed by an array of zero, or more, postids. .SH "NOTES" .IX Header "NOTES" .Sh "The Atom \s-1API\s0" .IX Subsection "The Atom API" In January 2004, Blogger announced their support for the Atom \&\s-1API\s0. .PP As of this writing (version 0.87) this package does \fBnot\fR support the Atom \s-1API\s0. If you need to do things Atom\-ish, your best bet is to use the XML::Atom package. .Sh "Content negotiation" .IX Subsection "Content negotiation" Persons trying to connect to a server using shortened URLs and content negotiation should not be surprised if they encounter weirdness and/or errors. Specifically, a \s-1HTTP\s0 406 error. .PP Some preliminary investigation suggests that, if there's a bug at play here, it's a bug somewhere deep in SOAP::Lite/HTTP::* land. .PP Patches are welcome. Otherwise, you've been warned. :\-) .PP See also : .SH "AUTHORS" .IX Header "AUTHORS" .Vb 2 \& Originally authored by Aaron Straup Cope \& Adopted by Christopher H. Laco .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" Net::Blogger::API::Core .PP Net::Blogger::Engine::Base .PP http://plant.blogger.com/api/ .SH "BUGS" .IX Header "BUGS" Hopefully, few. Please reports all bugs to : .PP .Vb 1 \& http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net::Blogger .Ve .SH "SOURCE" .IX Header "SOURCE" You can get the latest version of the source code from the Subversion repository at http://handelframework.com/svn/CPAN/Net\-Blogger/ .SH "LICENSE" .IX Header "LICENSE" Copyright (c) 2001\-2005 Aaron Straup Cope. .PP This is free software, you may use it and distribute it under the same terms as Perl itself.