[BACK]Return to OpenAMD.pm CVS log [TXT][DIR] Up to [local] / HOPE / Net-OpenAMD / lib / Net

Diff for /HOPE/Net-OpenAMD/lib/Net/OpenAMD.pm between version 1.6 and 1.7

version 1.6, 2010/06/27 01:52:33 version 1.7, 2010/06/27 04:11:22
Line 1 
Line 1 
 package Net::OpenAMD;  package Net::OpenAMD;
   
 # $AFresh1: OpenAMD.pm,v 1.5 2010/06/24 22:57:42 andrew Exp $  # $AFresh1: OpenAMD.pm,v 1.6 2010/06/27 00:52:33 andrew Exp $
   
 use warnings;  use warnings;
 use strict;  use strict;
Line 38 
Line 38 
         return $self;          return $self;
     }      }
   
     sub _get {      sub get {
         my ( $self, $action, $query ) = @_;          my ( $self, $action, $query ) = @_;
         my $ident = ident($self);          my $ident = ident($self);
   
Line 54 
Line 54 
         return JSON::Any->jsonToObj( $response->decoded_content );          return JSON::Any->jsonToObj( $response->decoded_content );
     }      }
   
     sub location  { my $self = shift; return $self->_get( 'location',  @_ ) }      sub location  { my $self = shift; return $self->get( 'location',  @_ ) }
     sub speakers  { my $self = shift; return $self->_get( 'speakers',  @_ ) }      sub speakers  { my $self = shift; return $self->get( 'speakers',  @_ ) }
     sub talks     { my $self = shift; return $self->_get( 'talks',     @_ ) }      sub talks     { my $self = shift; return $self->get( 'talks',     @_ ) }
     sub interests { my $self = shift; return $self->_get( 'interests', @_ ) }      sub interests { my $self = shift; return $self->get( 'interests', @_ ) }
     sub users     { my $self = shift; return $self->_get( 'users',     @_ ) }      sub users     { my $self = shift; return $self->get( 'users',     @_ ) }
     sub stats { croak 'Unused feature' }      sub stats { croak 'Unused feature' }
   
     sub DESTROY {      sub DESTROY {
Line 76 
Line 76 
   
 1;    # Magic true value required at end of module  1;    # Magic true value required at end of module
 __END__  __END__
   
 =head1 NAME  =head1 NAME
   
 Net::OpenAMD - Perl interface to the OpenAMD API  Net::OpenAMD - Perl interface to the OpenAMD API
Line 91 
Line 90 
   
     use Net::OpenAMD;      use Net::OpenAMD;
   
 =for author to fill in:      my $amd = Net::OpenAMD->new();
     Brief code example(s) here showing commonest usage(s).  
     This section will be as far as many users bother reading      my $location = $amd->location({ area => 'Engressia' });
     so make it as educational and exeplary as possible.  
   
   
 =head1 DESCRIPTION  =head1 DESCRIPTION
   
 This module is to make it easy to grab information from the OpenAMD project at  This module is to make it easy to grab information from the OpenAMD project at
Line 112 
Line 110 
   
 =head1 INTERFACE  =head1 INTERFACE
   
 =for author to fill in:  =head2 new
     Write a separate section listing the public components of the modules  
     interface. These normally consist of either subroutines that may be  
     exported, or methods that may be called on objects belonging to the  
     classes provided by the module.  
   
   Create a new object for accessing the OpenAMD API.
   
 =head1 DIAGNOSTICS      my $amd = Net::OpenAMD->new( $options );
   
 =for author to fill in:  $options is a hashref with configuration options.
     List every single error and warning message that the module can  
     generate (even the ones that will "never happen"), with a full  
     explanation of each problem, one or more likely causes, and any  
     suggested remedies.  
   
   Current options are
   
 =over  =over
   
 =item C<< Error message here, perhaps with %s placeholders >>  =item base_url
   
 [Description of error here]  A URL to the API, currently defaults to https://api.hope.net/api
   
 =item C<< Another error message here >>  =item ua
   
 [Description of error here]  Should be a pre-configured LWP::UserAgent or similar that returns a
   HTTP::Response object when its get method is called with a URI.
   
 [Et cetera, et cetera]  =back
   
   =head2 get
   
   This is the main method, although probably never used.  It has better/easier
   ways to access the different actions of the API.
   
       my $data = $amd->get( $action, $params );
   
   $params are anything that are supported by URI->query, they will get passed
   on the request.
   
   Here $data is a the JSON returned by the API converted to Perl reference.
   
   Helper methods you can call as $amd->method($params) are:
   
   =over
   
   =item interests
   
   =item location
   
   =item new
   
   =item speakers
   
   =item stats
   
   =item talks
   
   =item users
   
 =back  =back
   
   Unless specified, there is nothing different about any of the helper methods
   than just calling get($action) instead.  Depending on API changes, this may
   not always be the case.
   
   =head1 DIAGNOSTICS
   
   All methods should croak when an error occours.
   If the remote API returns a successful response that contains valid JSON, that
   will be decoded and returned.
   
 =head1 CONFIGURATION AND ENVIRONMENT  =head1 CONFIGURATION AND ENVIRONMENT
   
 =for author to fill in:  
     A full explanation of any configuration system(s) used by the  
     module, including the names and locations of any configuration  
     files, and the meaning of any environment variables or properties  
     that can be set. These descriptions must also include details of any  
     configuration language used.  
   
 Net::OpenAMD requires no configuration files or environment variables.  Net::OpenAMD requires no configuration files or environment variables.
   
   Net::OpenAMD uses LWP::UserAgent for requests and environment for that is
   not cleared.
   
 =head1 DEPENDENCIES  =head1 DEPENDENCIES
   
 =over  =head3 L<LWP::UserAgent>
   
 =item LWP::UserAgent  =head3 L<URI>
   
 =item Net::OAuth  =head3 L<Net::OAuth>
   
 =item JSON::Any  =head3 L<JSON::Any>
   
 =back  
   
 =head1 INCOMPATIBILITIES  =head1 INCOMPATIBILITIES
   
 =for author to fill in:  
     A list of any modules that this module cannot be used in conjunction  
     with. This may be due to name conflicts in the interface, or  
     competition for system or program resources, or due to internal  
     limitations of Perl (for example, many modules that use source code  
     filters are mutually incompatible).  
   
 None reported.  None reported.
   
   
 =head1 BUGS AND LIMITATIONS  =head1 BUGS AND LIMITATIONS
   
 =for author to fill in:  
     A list of known problems with the module, together with some  
     indication Whether they are likely to be fixed in an upcoming  
     release. Also a list of restrictions on the features the module  
     does provide: data types that cannot be handled, performance issues  
     and the circumstances in which they may arise, practical  
     limitations on the size of data sets, special cases that are not  
     (yet) handled, etc.  
   
 No bugs have been reported.  No bugs have been reported.
   
   =over
   
   =item Currently it does not support the OAuth that is required to log into the
   API and get information.
   
   =back
   
 Please report any bugs or feature requests to  Please report any bugs or feature requests to
 C<bug-net-openamd@rt.cpan.org>, or through the web interface at  C<bug-net-openamd@rt.cpan.org>, or through the web interface at

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>