2 # Query the QRZ Database server for a callsign
4 # from an idea by Steve Franke K9AN and information from Angel EA7WA
8 my ($self, $line) = @_;
9 my @list = split /\s+/, $line; # generate a list of callsigns
11 my $call = $self->call;
14 return (1, "SHOW/QRZ <callsign>, e.g. SH/QRZ g1tlh") unless @list;
18 my $t = new Net::Telnet;
20 push @out, $self->msg('call1', "QRZ.com");
22 $t->open(Host => "qrz.com",
26 $t->print("GET /database?callsign=$l HTTP/1.0\n\n");
27 Log('call', "$call: show/qrz $l");
29 while (my $result = $t->getline) {
30 # print "$state: $result";
31 if ($state eq 'call' && $result =~ /$l/i) {
34 } elsif ($state eq 'getaddr' || $state eq 'inaddr') {
35 if ($result =~ /^\s+([\w\s.,;:-]+)(?:<br>)?$/) {
37 unless ($line =~ /^\s+$/) {
39 $state = 'inaddr' unless $state eq 'inaddr';
42 $state = 'runout' if $state eq 'inaddr';
48 push @out, $self->msg('e18', 'QRZ.com');