added changes to sh/sun and sh/moon from Steve Franke K9AN
[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 use Net::Telnet;
14
15 my $t = new Net::Telnet;
16
17 push @out, $self->msg('call1');
18 foreach $l (@list) {
19         $t->open(Host     =>  "jeifer.pineknot.com",
20                          Port     =>  1235,
21                          Timeout  =>  5);
22         if ($t) {
23                 $t->print(uc $l);
24                 while (my $result = $t->getline) {
25                         push @out,$result;
26                 }
27                 $t->close;
28         } else {
29                 push @out, $self->msg('e18', 'PineKnot');
30         }
31 }
32
33 return (1, @out);