fix skipping of fields >= 900
[Biblio-Z3950.git] / GoogleBooks.pm
index 7806425..139ff94 100644 (file)
@@ -9,6 +9,9 @@ use JSON::XS;
 
 use base 'Scraper';
 
+my $pageCount_suffix = 'p.'; # English
+$pageCount_suffix = ' str.'; # Croatian
+
 my $debug = $ENV{DEBUG} || 0;
 
 sub diag {
@@ -89,8 +92,6 @@ diag "got $hits results, get first one";
 }
 
 
-our ( $hash, $marc );
-
 sub next_marc {
        my ($self,$format) = @_;
 
@@ -102,7 +103,7 @@ sub next_marc {
 
        my $id = $item->{id} || die "no id";
 
-       $marc = MARC::Record->new;
+       my $marc = MARC::Record->new;
        $marc->encoding('utf-8');
 
        if ( my $vi = $item->{volumeInfo} ) {
@@ -141,7 +142,7 @@ sub next_marc {
                        );
                }
 
-               $marc->add_fields(300,' ',' ','a' => $vi->{pageCount} . 'p.' ) if $vi->{pageCount};
+               $marc->add_fields(300,' ',' ','a' => $vi->{pageCount} . $pageCount_suffix ) if $vi->{pageCount};
                
                $marc->add_fields(520,' ',' ','a' => $vi->{description} ) if $vi->{description};