]> scm.dxcluster.org Git - spider.git/blob - perl/call.pl
restore talk "<call> not visible on cluster" message
[spider.git] / perl / 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 #
7 #
8 my ($self, $line) = @_;
9 my @list = split /\s+/, $line;                # generate a list of callsigns
10 my $l;
11 my $call = $self->call;
12 my @out;
13
14 return (1, "SHOW/CALL <callsign>, e.g. SH/CALL g1tlh") unless @list;
15
16 use Net::Telnet;
17
18 my $t = new Net::Telnet;
19
20 push @out, $self->msg('call1', 'AA6HF');
21 foreach $l (@list) {
22         $t->open(Host     =>  "jeifer.pineknot.com",
23                          Port     =>  1235,
24                          Timeout  =>  5);
25         if ($t) {
26                 $t->print(uc $l);
27                 Log('call', "$call: show/call \U$l");
28                 while (my $result = $t->getline) {
29                         push @out,$result;
30                 }
31                 $t->close;
32         } else {
33                 push @out, $self->msg('e18', 'AA6HF');
34         }
35 }
36
37 return (1, @out);