| Net-Blogger documentation | Contained in the Net-Blogger distribution. |
Net::Blogger::Engine::Slash::slashcode - Adds support for the Slashcode SOAP API.
There is none since this is the black box you're not supposed to look in.
Please docs for consult Net::Blogger::Engine::Slash.
Adds support for the Slashcode SOAP API.
Return the URI of the Slashcode XML-RPC proxy
Just returns SOAP by default
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 a postid or false.
Returns a hash ref whose keys are :
Returns an array of hashrefs (see docs for get_entry), or false.
Returns a postid or false.
Returns true or false.
1.0
$Date: 2005/03/26 19:29:08 $
Aaron Straup Cope
http://use.perl.org/~pudge/journal/3294
Copyright (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.
| Net-Blogger documentation | Contained in the Net-Blogger distribution. |
{
package Net::Blogger::Engine::Slash::slashcode; use strict; use Exporter; use Digest::MD5 'md5_hex'; use HTTP::Cookies; use URI; use Net::Blogger::Engine::Base; $Net::Blogger::Engine::Slash::slashcode::VERSION = '1.0'; @Net::Blogger::Engine::Slash::slashcode::ISA = qw ( Net::Blogger::Engine::Base ); @Net::Blogger::Engine::Slash::slashcode::EXPORT = qw (); @Net::Blogger::Engine::Slash::slashcode::EXPORT_OK = qw (); sub Transport { return "SOAP"; } sub Proxy { my $self = shift; my $proxy = shift; if ($proxy) { $self->{'_cookie'} = undef; $self->{'_client'} = undef; $self->{'_Proxy'} = $proxy; } return ( $self->{'_Proxy'}, cookie_jar => $self->_setUserCookie(), ); }
sub add_entry { my $self = shift; my $args = (ref($_[0]) eq "HASH") ? shift : { @_ }; my $call = $self->_Client()->call( "add_entry", $self->_Type(string=>$args->{"subject"}), $self->_Type(string=>$args->{"body"}), ); return ($call) ? $call->result() : return 0; }
sub get_entry { my $self = shift; my $call = $self->_Client()->call( "get_entry", $self->_Type(int=>$_[0]), ); return ($call) ? $call->result() : return 0; }
sub get_entries { my $self = shift; my $call = $self->_Client()->call("get_entries", $self->_Type(string=>$self->Username()), $self->_Type(int=>$_[0]), ); return ($call) ? $call->result() : return 0; }
sub modify_entry { my $self = shift; my $postid = shift; my $args = (ref($_[0]) eq "HASH") ? shift : { @_ }; my $call = $self->_Client()->call("modify_entry", $self->_Type(int=>$postid), $self->_Type(string=>$args->{"subject"}), $self->_Type(string=>$args->{"body"}), ); return ($call) ? $call->result() : return 0; }
sub delete_entry { my $self = shift; my $call = $self->_Client()->call("delete_entry", $self->_Type(int=>$_[0]), ); return ($call) ? $call->result() : return 0; } sub _setUserCookie { my $self = shift; if (! $self->{'_cookie'}) { my $cookie = join("::",$self->Username(),md5_hex($self->Password())); $cookie =~ s/(.)/sprintf("%%%02x", ord($1))/ge; $cookie =~ s/%/%25/g; $self->{'_cookie'} = HTTP::Cookies->new()->set_cookie(0, user=>$cookie, '/', URI->new($self->{'_Proxy'})->host(), ), } return $self->{'_cookie'}; }
return 1; }