X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fcall.pl;h=8c089e00d8881032f4d0f0bb23d0c11affda9499;hb=e49e641d1a518e4f3b4308e078e06653e0b91a38;hp=89cdb2f05c37d986c9689b46b364e0aca620c8c8;hpb=78ed3f6025103ec1c47c90725e37b417647d83c8;p=spider.git diff --git a/perl/call.pl b/perl/call.pl index 89cdb2f0..8c089e00 100755 --- a/perl/call.pl +++ b/perl/call.pl @@ -1,20 +1,37 @@ -#!/usr/bin/perl # -# a little program to see if I can use ax25_call in a perl script +# Query the PineKnot Database server for a callsign # +# from an idea by Steve Franke K9AN and information from Angel EA7WA +# +# +# +my ($self, $line) = @_; +my @list = split /\s+/, $line; # generate a list of callsigns +my $l; +my $call = $self->call; +my @out; -use FileHandle; -use IPC::Open2; - -$pid = Open2( \*IN, \*OUT, "ax25_call ether GB7DJK-1 G1TLH"); +return (1, "SHOW/CALL , e.g. SH/CALL g1tlh") unless @list; -IN->input_record_separator("\r"); -OUT->output_record_separator("\r"); -OUT->autoflush(1); +use Net::Telnet; -vec($rin, fileno(STDIN), 1) = 1; -vec($rin, fileno(IN), 1) = 1; +my $t = new Net::Telnet; -while (($nfound = select($rout=$rin, undef, undef, 0.001)) >= 0) { - +push @out, $self->msg('call1', 'AA6HF'); +foreach $l (@list) { + $t->open(Host => "jeifer.pineknot.com", + Port => 1235, + Timeout => 5); + if ($t) { + $t->print(uc $l); + Log('call', "$call: show/call \U$l"); + while (my $result = $t->getline) { + push @out,$result; + } + $t->close; + } else { + push @out, $self->msg('e18', 'AA6HF'); + } } + +return (1, @out);