Debian Codegraph @

examples/parsing/openurl.pl

raw
1 #!/usr/bin/perl
2
3 # This example creates an OpenURL address from a parsed reference.
4
5 use Biblio::Citation::Parser::Standard;
6 use Biblio::Citation::Parser::Utils;
7 use URI::OpenURL;
8
9 $ref = "Jewell, M (2002) Making Examples for Reference Parsers. Journal of Example Writing 3:100-150.";
10
11 print "- Parsing $ref\n";
12 my $cit_parser = new Biblio::Citation::Parser::Standard;
13 $metadata = $cit_parser->parse($ref);
14 print "- Creating OpenURL (BaseURL set to http://paracite.eprints.org/cgi-bin/openurl.cgi)\n";
15 print URI::OpenURL->new('http://paracite.eprints.org/cgi-bin/openurl.cgi')->referent(%$metadata)->as_string();
16 my($openurl,@errors) = create_openurl($metadata);
17 print "http://paracite.eprints.org/cgi-bin/openurl.cgi?".$openurl."\n";