Catmandu::Importer::Pure(3pm) | User Contributed Perl Documentation | Catmandu::Importer::Pure(3pm) |
Catmandu::Importer::Pure - Package that imports Pure data.
# From the command line $ catmandu convert Pure \ --base https://host/ws/api/... \ --endpoint research-outputs \ --apiKey "..." # In Perl use Catmandu; my %attrs = ( base => 'https://host/path', endpoint => 'research-outputs', apiKey => '...', options => { 'fields' => 'title,type,authors.*' } ); my $importer = Catmandu->importer('Pure', %attrs); my $n = $importer->each(sub { my $hashref = $_[0]; # ... }); # get number of validated and approved publications my $count = Catmandu->importer( 'Pure', base => 'https://host/path', endpoint => 'research-outputs', apiKey => '...', fullResponse => 1, post_xml => '<?xml version="1.0" encoding="utf-8"?>' . '<researchOutputsQuery>' . '<size>0</size>' . '<workflowSteps>' . ' <workflowStep>approved</workflowStep>' . ' <workflowStep>validated</workflowStep>' . '</workflowSteps>' . '</researchOutputsQuery>' )->first->{count};
Catmandu::Importer::Pure is a Catmandu package that seamlessly imports data from Elsevier's Pure system using its REST service. In order to use the Pure Web Service you need an API key. List of all available endpoints and further documentation can currently be found under /ws on a webserver that is running Pure. Note that this version of the importer is tested with Pure API version 5.18 and might not work with later versions.
If the flag is false then the items are set to child elements of the element 'result' or in case the 'result' element does not exist they are set to child elements of the root element for each response.
Handlers can be provided as function reference, an instance of a Perl package that implements 'parse', or by a package NAME. Package names should be prepended by "+" or prefixed with "Catmandu::Importer::Pure::Parser". E.g "foobar" will create a "Catmandu::Importer::Pure::Parser::foobar" instance.
By default the handler Catmandu::Importer::Pure::Parser::simple is used. It provides a simple XML parsing, using XML::LibXML::Simple,
Other possible values are Catmandu::Importer::Pure::Parser::struct for XML::Struct based structure that preserves order and Catmandu::Importer::Pure::Parser::raw that returns the XML as it is.
In addition to methods inherited from Catmandu::Iterable, this module provides the following public methods:
Catmandu
Catmandu::Importer
Catmandu::Iterable
Furl
Snorri Briem <briem@cpan.org>
Copyright 2017- Lund University Library
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
2023-02-04 | perl v5.36.0 |