| EVDB-API documentation | Contained in the EVDB-API distribution. |
EVDB::API::JSON - Use the JSON flavor of the Eventful API
my $evdb = EVDB::API->new(app_key => $app_key, flavor => 'json');
my $results = $evdb->call('events/get', { id => 'E0-001-001336058-5' });
Parses JSON from the Eventful API.
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.
| EVDB-API documentation | Contained in the EVDB-API distribution. |
package EVDB::API::JSON; use strict; use warnings; use Carp;
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;