From 55056d76ffafa69782a23bf830a0dc9e8c161838 Mon Sep 17 00:00:00 2001 From: minima Date: Sat, 28 Oct 2000 10:51:27 +0000 Subject: [PATCH] added changes to sh/sun and sh/moon from Steve Franke K9AN reworked his show/ham into sh/call --- Changes | 6 ++++++ cmd/show/call.pl | 33 +++++++++++++++++++++++++++++++++ cmd/show/moon.pl | 6 +++--- cmd/show/sun.pl | 4 ++-- perl/Messages | 2 ++ 5 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 cmd/show/call.pl diff --git a/Changes b/Changes index d553ce87..d91bea2a 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,9 @@ +28Oct00======================================================================= +1. updated show/sun and show/moon from stuff sent by Steve Franke K9 +2. added show/call which queries jeifer.pineknot.com for any call in the +world (as opposed to UALR which only does US calls). Inspired by a bit of +perl sent to me by Steve Franke (again!) and also Angel EA7WA who gave me the +pineknot ip address. 27Oct00======================================================================= 1. alter the code in clean_old of DXMsg system to see if we get some different behaviour with random crashing diff --git a/cmd/show/call.pl b/cmd/show/call.pl new file mode 100644 index 00000000..92a99234 --- /dev/null +++ b/cmd/show/call.pl @@ -0,0 +1,33 @@ +# +# Query the PineKnot Database server for a callsign +# +# from an idea by Steve Franke K9AN and information from Angel EA7WA +# +# $Id$ +# +my ($self, $line) = @_; +my @list = split /\s+/, $line; # generate a list of callsigns +my $l; +my @out; + +use Net::Telnet; + +my $t = new Net::Telnet; + +push @out, $self->msg('call1'); +foreach $l (@list) { + $t->open(Host => "jeifer.pineknot.com", + Port => 1235, + Timeout => 5); + if ($t) { + $t->print(uc $l); + while (my $result = $t->getline) { + push @out,$result; + } + $t->close; + } else { + push @out, $self->msg('e18', 'PineKnot'); + } +} + +return (1, @out); diff --git a/cmd/show/moon.pl b/cmd/show/moon.pl index b1e4feb4..ef1ba457 100644 --- a/cmd/show/moon.pl +++ b/cmd/show/moon.pl @@ -1,9 +1,9 @@ #!/usr/bin/perl # -# show sunrise and sunset times for each callsign or prefix entered +# show moonrise and moonset times for each callsign or prefix entered # # 1999/11/9 Steve Franke K9AN -# +# 2000/10/27 fixed bug involving degree to radian conversion. my ($self, $line) = @_; my @list = split /\s+/, $line; @@ -21,7 +21,7 @@ if (@list) { foreach $l (@list) { my $user = DXUser->get_current(uc $l); if ($user && $user->lat && $user->long) { - push @in, [$user->qth, $user->lat * $d2r, $user->long * -$d2r, uc $l ]; + push @in, [$user->qth, $user->lat, -$user->long, uc $l ]; } else { # prefixes ---> my @ans = Prefix::extract($l); diff --git a/cmd/show/sun.pl b/cmd/show/sun.pl index 80eb54ee..07172ce0 100644 --- a/cmd/show/sun.pl +++ b/cmd/show/sun.pl @@ -3,7 +3,7 @@ # show sunrise and sunset times for each callsign or prefix entered # # 1999/11/9 Steve Franke K9AN -# +# 2000/10/27 fixed bug involving degree to radian conversion. my ($self, $line) = @_; my @list = split /\s+/, $line; @@ -21,7 +21,7 @@ if (@list) { foreach $l (@list) { my $user = DXUser->get_current(uc $l); if ($user && $user->lat && $user->long) { - push @in, [$user->qth, $user->lat * $d2r, $user->long * -$d2r, uc $l ]; + push @in, [$user->qth, $user->lat, -$user->long, uc $l ]; } else { # prefixes ---> my @ans = Prefix::extract($l); diff --git a/perl/Messages b/perl/Messages index e7d9d8c6..36168778 100644 --- a/perl/Messages +++ b/perl/Messages @@ -18,6 +18,7 @@ package DXM; bbs => 'Your BBS Address is now \"$_[0]\"', beepoff => 'Beeps are now off', beepon => 'Beeps are now on', + call1 => 'Callsign lookup via Pineknot:', conother => 'Sorry $_[0] you are connected on another port', concluster => 'Sorry $_[0] you are already connected elsewhere on the cluster', conscript => 'no connect script called \"$_[0]\" found in $main::root/connect', @@ -58,6 +59,7 @@ package DXM; e15 => 'invalid qualifier \"$_[0]\"', e16 => 'File \"$_[0]\" exists', e17 => 'Please don\'t use the words: @_ on here', + e18 => 'Cannot connect to $_[0] ($!)', echoon => 'Echoing enabled', echooff => 'Echoing disabled', -- 2.43.0