1 # $Id: zoomscan.pl,v 1.2 2007-08-16 16:21:08 mike Exp $
3 # This is the scanning counterpart to zoomscan.pl's searching
4 # perl -I../../blib/lib -I../../blib/arch zoomscan.pl <target> <scanQuery>
11 print STDERR "Usage: $0 target scanQuery\n";
12 print STDERR " eg. $0 z3950.indexdata.dk/gils computer\n";
15 my($host, $scanQuery) = @ARGV;
18 my $conn = new ZOOM::Connection($host, 0);
19 $conn->option(preferredRecordSyntax => "usmarc");
20 ### Could use ZOOM::Query::CQL below, but that only work in SRU/W.
21 my $ss = $conn->scan(new ZOOM::Query::PQF($scanQuery));
24 my($term, $occ) = $ss->term($i);
25 print $i+1, ": $term";
26 print " ($occ)" if defined $occ;
33 die "Non-ZOOM error: $@" if !$@->isa("ZOOM::Exception");
34 print STDERR "ZOOM error $@\n";