Group
Extension

Matches 6

WebService-Pandora ( D/DE/DEFCON/WebService-Pandora-0.4.tar.gz, DEFCON, 2016; MetaCPAN )
WebService-Pandora/lib/WebService/Pandora.pm ( view source; MetaCPAN )
e::Pandora::Method;
use WebService::Pandora::Cryptor;
use WebService::Pandora::Partner::iOS;

use JSON;
use Data::Dumper;

our $VERSION = '0.4';

### constructor ###

sub new {

    my $caller = shift
deExtendedAttributes'};

    $includeExtendedAttributes = ( $includeExtendedAttributes ) ? JSON::true() : JSON::false();

    # make sure they provided a stationToken argument
    if ( !defined( $stat
Positive must be specified.' );
        return;
    }

    $isPositive = ( $isPositive ) ? JSON::true() : JSON::false();

    # create the station.addFeedback method w/ appropriate params
    my $meth
WebService-Pandora ( D/DE/DEFCON/WebService-Pandora-0.4.tar.gz, DEFCON, 2016; MetaCPAN )
WebService-Pandora/lib/WebService/Pandora/Method.pod ( view source; MetaCPAN )
or() );

=head1 DESCRIPTION

B<WebService::Pandora::Method> is a module which queries the Pandora JSON API using the
B<LWP::UserAgent> and B<HTTP::Request> libraries.  It is used by the main B<WebServ
dule for all of the webservice methods it exposes.  It handles all of the encryption,
decryption, JSON conversion, and the Pandora API oddities for you.

=head1 CONSTRUCTOR

=head2 new

Creates a new 
iven.  The method can
then be B<execute()>ed, returning a decrypted hashref representation of the JSON string returned
by the Pandora API method.

  $method = WebService::Pandora::Method->new( name =>
WebService-Pandora ( D/DE/DEFCON/WebService-Pandora-0.4.tar.gz, DEFCON, 2016; MetaCPAN )
WebService-Pandora/lib/WebService/Pandora/Partner.pod ( view source; MetaCPAN )
to use when encrypting the JSON data being sent to the
Pandora API method.

=item decryption_key =E<gt> STRING [required]

The decryption key to use when decrypting the JSON data send back from the
Pa
WebService-Pandora ( D/DE/DEFCON/WebService-Pandora-0.4.tar.gz, DEFCON, 2016; MetaCPAN )
WebService-Pandora/lib/WebService/Pandora/Cryptor.pod ( view source; MetaCPAN )
::Cryptor> is used to encrypt and decrypt the data sent to and from
the Pandora JSON API.  Some methods require the JSON to be sent using the Blowfish
algorithm in ECB mode.  Some of the attributes re
is passed
a true value for the B<encrypt> boolean, it uses this module to do so for the submitted
JSON data.

=head1 CONSTRUCTOR

=head2 new

Creates a B<WebService::Pandora::Cryptor> object with the 
encrypted string of the JSON data given that the Pandora
API expects, using the provided B<encryption_key> specified in the constructor.

  $encrypted = $cryptor->encrypt( $json_str );

=head2 decrypt
WebService-Pandora ( D/DE/DEFCON/WebService-Pandora-0.4.tar.gz, DEFCON, 2016; MetaCPAN )
WebService-Pandora/lib/WebService/Pandora/Method.pm ( view source; MetaCPAN )
ice::Pandora::Method;

use strict;
use warnings;

use WebService::Pandora::Cryptor;

use URI;
use JSON;
use HTTP::Request;
use LWP::UserAgent;
use Data::Dumper;

### constructor ###

sub new {

    my
 = LWP::UserAgent->new( timeout => $self->{'timeout'} );

    # create and store json object
    $self->{'json'} = JSON->new();

    return $self;
}

### getters/setters ###

sub error {

    my ( $se
.' );
        return;
    }

    # craft the json data accordingly
    my $json_data = {};

    if ( defined( $self->{'userAuthToken'} ) ) {

        $json_data->{'userAuthToken'} = $self->{'userAuthT
WebService-Pandora ( D/DE/DEFCON/WebService-Pandora-0.4.tar.gz, DEFCON, 2016; MetaCPAN )
WebService-Pandora/lib/WebService/Pandora.pod ( view source; MetaCPAN )
N

B<WebService::Pandora> is a module to communicate with the Pandora (L<http://www.pandora.com>) JSON API.
The API is not officially published, and has a few oddities, but was reverse engineered and 

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.