/[meteor]/trunk/Meteor/Koha.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/Meteor/Koha.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 70 - (hide annotations)
Sat Mar 28 03:45:31 2009 UTC (15 years, 1 month ago) by dpavlin
File size: 642 byte(s)
make Meteor::Koha for integration
1 dpavlin 70 package Meteor::Koha;
2    
3     use strict;
4     use warnings;
5    
6     use LWP::UserAgent;
7    
8     my $ua = LWP::UserAgent->new;
9    
10     sub item {
11     my ( $class, $client, $item ) = @_;
12    
13     my $url = 'http://koha.ffzg.hr/cgi-bin/koha/opac-detail.pl?biblionumber=' . $item;
14    
15     my $response = $ua->get( $url );
16    
17     my $html = $response->content;
18     $html =~ s{<head>.+?<h1>}{<h1>}s;
19     $html =~ s{<div class="content_set">.+$}{}s;
20    
21     my $len = length($html);
22    
23     warn "# koha item $item [$len]\n";
24    
25     $client->write(
26     'HTTP/1.1 ' . $response->status_line . "\r\n" .
27     "Content-Type: text/html\r\n" .
28     "Content-length: $len\r\n" .
29     "Connection: close\r\n" .
30     "\r\n\r\n$html\r\n"
31     );
32    
33     }
34    
35     1;

  ViewVC Help
Powered by ViewVC 1.1.26