]> dxcluster.net Git - spider.git/blob - cmd/show/call.pl
tidied up the filtering help a bit
[spider.git] / cmd / show / call.pl
1 #
2 # Query the PineKnot Database server for a callsign
3 #
4 # from an idea by Steve Franke K9AN and information from Angel EA7WA
5 #
6 # $Id$
7 #
8 my ($self, $line) = @_;
9 my @list = split /\s+/, $line;                # generate a list of callsigns
10 my $l;
11 my @out;
12
13 return (1, "SHOW/CALL <callsign>, e.g. SH/CALL g1tlh") unless @list;
14
15 use Net::Telnet;
16
17 my $t = new Net::Telnet;
18
19 push @out, $self->msg('call1');
20 foreach $l (@list) {
21         $t->open(Host     =>  "jeifer.pineknot.com",
22                          Port     =>  1235,
23                          Timeout  =>  5);
24         if ($t) {
25                 $t->print(uc $l);
26                 Log('call', "show/call $l");
27                 while (my $result = $t->getline) {
28                         push @out,$result;
29                 }
30                 $t->close;
31         } else {
32                 push @out, $self->msg('e18', 'PineKnot');
33         }
34 }
35
36 return (1, @out);