3 # $Id: irspy.pl,v 1.2 2006-05-18 21:58:43 mike Exp $
6 # YAZ_LOG=irspy perl -I lib irspy.pl -t "bagel.indexdata.dk/gils z3950.loc.gov:7090/Voyager" localhost:1313/IR-Explain---1
11 use Net::Z3950::IRSpy;
16 if (!getopts('t:au', \%opts) || @ARGV != 1) {
17 print STDERR qq[Usage: $0 [options] <IRSpy-database>
18 -t <t1 t2 ...> Space-separated list of targets to check
19 -a Check all targets registered in database
20 -u Update information in database
25 my $dbname = $ARGV[0];
26 my $targetList = $opts{t};
27 if (!defined $targetList && !$opts{a}) {
28 print STDERR "$0: neither -t nor -a specified\n";
32 my $spy = new Net::Z3950::IRSpy($dbname);
33 $spy->targets($targetList) if defined $targetList;
35 my $query = $spy->query();
36 my $n = $spy->hitcount();
37 print "found $n records from query: $query\n";