Subject: | HTTP::OAI::Harvester GetRecord() method hangs? |
Dear reader,
the attached script is trying to get all records from
http://arachne.uni-koeln.de:8080/OAI-PMH/oai-pmh.xml .
The script is fetching one identifier at a time and then is trying to
get the according record via GetRecord(), but there the script is using
100% cpu and does not seem to end anymore.
I am not sure if the repository has changed something, but i think there
should be an error or the script should be able to get the data.
The first record could be get by
wget -O -
'http://arachne.uni-koeln.de:8080/OAI-PMH/oai-pmh.xml?verb=GetRecord&metadataPrefix=mets&identifier=oai%3Aarachne.uni-koeln.de%3Abuch%2F1'
Kind regards,
JB
Subject: | getMets.pl |
#!/usr/bin/perl
use strict;
use utf8;
binmode(STDOUT, ":utf8");
use HTTP::OAI;
use HTTP::OAI::ListRecords;
my $h = HTTP::OAI::Harvester->new(
repository=>HTTP::OAI::Identify->new(
baseURL => 'http://arachne.uni-koeln.de:8080/OAI-PMH/oai-pmh.xml',
version => '2.0',
));
my $response=$h->ListIdentifiers(metadataPrefix=>"mets", set=>"semantique");
if( $response->is_error ) {
die("Error harvesting: " . $response->message . "\n");
}
while(my $id=$response->next) {
print "getting ".$id->identifier."\n";
my $gr=$h->GetRecord(identifier=>$id->identifier, metadataPrefix=>"mets");
if($gr->is_error) { warn $gr->message; next; }
die "got one record\n";
}