mirror missing biblio marc records from koha
authordpavlin <dpavlin@rot13.org>
Mon, 25 May 2015 13:37:56 +0000 (15:37 +0200)
committerdpavlin <dpavlin@rot13.org>
Mon, 25 May 2015 13:37:56 +0000 (15:37 +0200)
tsv2eprints.pl

index d49fd95..254f51d 100755 (executable)
@@ -18,6 +18,7 @@ use utf8;
 use Encode;
 use Data::Dump qw(dump);
 use Storable;
+use LWP::Simple;
 
 =for eprints-api
 
@@ -126,4 +127,13 @@ warn "## row = ",dump( \%row );
 
 warn "# files left ", dump($files);
 
+foreach my $biblionumber ( keys %$files ) {
+       if ( my $marc = get("https://koha.ffzg.hr/cgi-bin/koha/opac-export.pl?op=export&bib=$biblionumber&format=utf8") ) {
+               print $import_fh $marc;
+               warn "## marc $biblionumber from koha!";
+       } else {
+               warn "ERROR: can't fetch $biblionumber from koha";
+       }
+}
+
 warn "# stat ", dump($stat);