year limit 2008-2013
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 24 Nov 2013 17:10:03 +0000 (18:10 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 24 Nov 2013 17:12:01 +0000 (18:12 +0100)
html.pl

diff --git a/html.pl b/html.pl
index c56f9df..ab97e14 100755 (executable)
--- a/html.pl
+++ b/html.pl
@@ -155,7 +155,7 @@ while( my $row = $sth_select_authors->fetchrow_hashref ) {
 
         if ($elt->localname eq 'controlfield') {
                        if ( $tag eq '008' ) {
-                                $biblio_year->{ $row->{biblionumber} } = substr($elt->textContent, 7, 4 );
+                                $biblio_year->{ $row->{biblionumber} } = $data->{year} = substr($elt->textContent, 7, 4 );
                        }
                        next;
         } elsif ($elt->localname eq 'datafield') {
@@ -173,6 +173,14 @@ while( my $row = $sth_select_authors->fetchrow_hashref ) {
         }
     }
 
+       if ( $data->{year} < 2008 ) {
+               push @{ $skip->{year_lt_2008} }, $row->{biblionumber};
+               next;
+       } elsif ( $data->{year} > 2013 ) {
+               push @{ $skip->{year_gt_2013} }, $row->{biblionumber};
+               next;
+       }
+
 #      warn "# ", $row->{biblionumber}, " data ",dump($data);
 
        my $category = $data->{942}->[0]->{'t'};