| WebService-Eventful documentation | Contained in the WebService-Eventful distribution. |
WebService::Eventful::JSON - Use the JSON flavor of the Eventful API
my $evdb = WebService::Eventful->new(app_key => $app_key, flavor => 'json');
my $results = $evdb->call('events/get', { id => 'E0-001-001336058-5' });
Parses JSON from the Eventful API.
1.0 - September 2006
Return the flavor name.
Return a checkstring for the expected return content type.
Parse JSON data from the Eventful API using JSON::Syck or JSON.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| WebService-Eventful documentation | Contained in the WebService-Eventful distribution. |
package WebService::Eventful::JSON; use strict; use warnings; use Carp;
our $VERSION = 1.0;
sub flavor { 'json' }
sub ctype { 'javascript' }
sub parse { my ($class, $data, $force_array) = @_; carp "Forcing arrays is not supported for API flavor " . $class->flavor if $force_array; eval { require JSON::Syck }; if ($@) { require JSON; return JSON::jsonToObj($data); } else { return JSON::Syck::Load($data); } }
1;