| EVDB-API documentation | Contained in the EVDB-API distribution. |
EVDB::API::REST - Use the REST flavor of the Eventful API
my $evdb = EVDB::API->new(app_key => $app_key);
my $results = $evdb->call('events/get', { id => 'E0-001-001336058-5' });
Parses XML from the Eventful API.
Return the flavor name.
Return a checkstring for the expected return content type.
Parse XML data from the Eventful API using XML::Twig or XML::Simple.
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::REST; use strict; use warnings;
sub flavor { 'rest' }
sub ctype { 'xml' }
sub parse { my ($class, $data, $force_array) = @_; eval { require XML::Twig }; if ($@) { require XML::Simple; my $xs = XML::Simple->new( KeyAttr => [], SuppressEmpty => '', ); return $xs->XMLin($data, ForceArray => $force_array); } else { my $twig = XML::Twig->new; $twig->parse($data); my $parsed = $twig->simplify(keyattr => [], forcearray => $force_array); $twig->purge; return $parsed; } }
1;