--- trunk/Meteor/Koha.pm 2009/03/28 03:45:31 70 +++ trunk/Meteor/Koha.pm 2009/03/28 14:20:59 71 @@ -7,23 +7,37 @@ my $ua = LWP::UserAgent->new; +our $cache; + sub item { my ( $class, $client, $item ) = @_; - my $url = 'http://koha.ffzg.hr/cgi-bin/koha/opac-detail.pl?biblionumber=' . $item; + my $html; + + if ( $html = $cache->{$item} ) { + + warn "# koha item $item from cache\n"; + + } else { + + my $url = 'http://koha.ffzg.hr/cgi-bin/koha/opac-detail.pl?biblionumber=' . $item; + + my $response = $ua->get( $url ); - my $response = $ua->get( $url ); + $html = $response->content; + $html =~ s{
.+?