| Net-Blogger documentation | Contained in the Net-Blogger distribution. |
Net::Blogger::Engine::Userland - base class for UserLand Blogger API engines
It's very dark in here because this is a black box.
This package inherits Net::Blogger::Engine::Base and implements shared methods for the UserLand Manila and RadioUserland XML-RPC servers.
This package should not be called directly. It is a base class used by Net::Blogger::Engine::Manila and Net::Blogger::Engine::Radio
Releases prior to Net::Blogger 0.85 accepted a list of arguments rather than a reference. Version 0.85+ are backwards compatible.
Get/set the URI of the Manila->Blogger proxy.
If no proxy is explicitly defined then the method determines the hostname for the Manila server using the current blogid.
"Just to clarify, the URI is /RPC2, even if your blogid (homepage url) is
a sub-site url, like http://www.myserver.com/mysite/. It's never something
like /mysite/RPC2."
--Jake Savin (Userland)
Returns true. Manila does not require a Blogger API key, but specifies something (anything) all the same.
Get/Set the current blog id.
Ensures that the blogid contains a trailing slash, without which the Frontier engine freaks out.
By default, returns undef. In other words, there is no max post length for Manila.
"As far as I know there is no max length for a post, certainly nothing you have to enforce on your end." --Dave Winer (Userland)
Returns an object. Woot!
1.0
$Date: 2005/03/26 19:29:08 $
Aaron Straup Cope
http://frontier.userland.com/emulatingBloggerInManila
Copyright (c) 2001-2005 Aaron Straup Cope.
This is free software, you may use it and distribute it under the same terms as Perl itself.
| Net-Blogger documentation | Contained in the Net-Blogger distribution. |
{
package Net::Blogger::Engine::Userland; use strict; $Net::Blogger::Engine::Userland::VERSION = '1.0'; @Net::Blogger::Engine::Userland::ISA = qw ( Exporter Net::Blogger::Engine::Base ); @Net::Blogger::Engine::Userland::EXPORT = qw (); @Net::Blogger::Engine::Userland::EXPORT_OK = qw (); use Net::Blogger::Engine::Base; use Exporter; use URI;
sub init { my $self = shift; my $args = (ref($_[0]) eq "HASH") ? shift : {@_}; my $child = caller(); if (! $child =~ /^(Net::Blogger::Engine::(Manila|Radio))$/) { return 0; } if (exists $args->{'proxy'}) { $self->Proxy($args->{'proxy'}); delete $args->{'proxy'}; } return $self->SUPER::init($args); }
sub Proxy { my $self = shift; my $proxy = shift; if ($proxy) { $self->{"_proxy"} = $proxy; return $self->{"_proxy"}; } if ($self->{"_proxy"}) { return $self->{"_proxy"}; } if (my $blog = $self->BlogId()) { my $uri = URI->new($blog); $self->{"_proxy"} = $uri->scheme()."://".$uri->host()."/RPC2"; $self->{"_client"} = undef; return $self->{"_proxy"}; } $self->LastError("Unable to determine proxy explicitly or by parsing blogid."); return undef; }
sub AppKey { my $self = shift; return 1; }
sub BlogId { my $self = shift; my $id = shift; if ($id) { unless ($id =~ /^(.*)\/$/) { $id .= "/"; } $self->{'_blogid'} = $id; } return $self->{'_blogid'}; }
sub MaxPostLength { my $self = shift; return undef; }
sub metaWeblog { my $self = shift; if (! $self->{__meta}) { require Net::Blogger::Engine::Userland::metaWeblog; my $meta = Net::Blogger::Engine::Userland::metaWeblog->new(debug=>$self->{debug}); map { $meta->$_($self->$_()); } qw (BlogId Proxy Username Password ); $self->{__meta} = $meta; } return $self->{__meta}; } return 1;
}