Catmandu::Importer::CrossRef - Package that imports data form CrossRef API
use Catmandu::Importer::CrossRef; my %attrs = ( doi => '<doi>', usr => '<your-crossref-username>', pwd => '<your-crossref-password>', fmt => '<xsd_xml | unixref | unixsd | info>' ); my $importer = Catmandu::Importer::CrossRef->new(%attrs); my $n = $importer->each(sub { my $hashref = $_[0]; # do something here });
This Catmandu::Importer imports data from the CrossRef API given a DOI.
Base url of the API. Default is to http://doi.crossref.org/search/doi.
Required. The DOI you want data about.
Required. Your CrossRef username. Register first!
The optional output format. Default is unixref. Other possible values are unixsd, and xsd_xml (deprecated).
Catmandu::Importer::DOI is an older version of this module.
CrossRef also provides DOI data in RDF, which can be imported with Catmandu::RDF:
use Catmandu::Importer::RDF; my $doi = "10.2474/trol.7.147"; my $url = "http://dx.doi.org/$doi"; my $rdf = Catmandu::Importer::RDF->new( url => $url )->first;
To install Catmandu::CrossRef, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catmandu::CrossRef
CPAN shell
perl -MCPAN -e shell install Catmandu::CrossRef
For more information on module installation, please visit the detailed CPAN module installation guide.