| Net-Google-GData documentation | Contained in the Net-Google-GData distribution. |
Net::Google::GData - Handle basic communication with Google services
Version 0.01
Net::Google::GData handles the basic communication details with Google services.
This module should normally only be used by modules subclassing GData.
Typical constructor. You can optionally pass in a hash of data to set values. Unknown data/value pairs will be silently ignored.
Private method that creates and holds a LWP user agent.
Does not accept any parameters.
Alan Young, <alansyoungiii at gmail.com>
Please report any bugs or feature requests to
bug-net-google-gdata at rt.cpan.org, or through the web interface at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Google-GData.
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc Net::Google::GData
You can also look for information at:
Copyright 2007 Alan Young, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Net-Google-GData documentation | Contained in the Net-Google-GData distribution. |
package Net::Google::GData; use warnings; use strict;
our $VERSION = '0.01';
use Carp; use LWP::UserAgent; use base qw( Class::Accessor Class::ErrorHandler Net::Google::Authenticate ); __PACKAGE__->mk_accessors(qw( ));
sub new { my ( $class, @data ) = @_; my $self = bless {}, ref $class || $class; # Set some defaults $self->accountType( $self->_default_accountType ) or croak $self->errstr; $self->service( $self->_default_service ) or carp $self->errstr; $self->source( 'Base GData Perl Package/' . $VERSION ); for ( my $i = 0 ; $i < @data ; $i += 2 ) { if ( my $method = $self->can( $data[$i] ) ) { $self->$method( $data[$i+1] ); } } return $self; }
sub GET { } sub POST { } sub PUT { } sub DELETE { }
sub _ua { my $self = shift; my $ua; unless ( $ua = $self->SUPER::get( '_ua' ) ) { $ua = LWP::UserAgent->new; $self->SUPER::set( '_ua', $ua ); } $ua->agent( $self->source ); $self->_auth ? $ua->default_header( 'Authorization' => 'GoogleLogin auth=' . $self->_auth ) : $ua->default_headers->remove_header( 'Authorization' ); return $ua; }
1; # End of Net::Google::GData