From 48e2f0092d89db018a6744d4d35b83156cbe0481 Mon Sep 17 00:00:00 2001 From: minima Date: Mon, 14 Oct 2002 13:18:28 +0000 Subject: [PATCH] added show/usdb --- Changes | 3 +++ cmd/Commands_en.hlp | 6 ++++++ cmd/show/usdb.pl | 29 +++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 cmd/show/usdb.pl diff --git a/Changes b/Changes index 2f6b6aac..524b2ade 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ +14Oct02======================================================================= +1. added show/usdb command as a simple, direct interface to the information +available in the USDB stuff. 13Oct02======================================================================= 1. A large change has occurred. There is now some (optional) US state recog- nition. This is in its early stages but appears to work for me. You will need diff --git a/cmd/Commands_en.hlp b/cmd/Commands_en.hlp index eca6dacb..51d1622e 100644 --- a/cmd/Commands_en.hlp +++ b/cmd/Commands_en.hlp @@ -2058,6 +2058,12 @@ time and UTC as the computer has it right now. If you give some prefixes then it will show UTC and UTC + the local offset (not including DST) at the prefixes or callsigns that you specify. +=== 0^SHOW/USDB [call ..]^Show information held on the FCC Call database +Show the City and State of a Callsign held on the FCC database if +his is being run on this system, eg:- + + sh/usdb k1xx + === 0^SHOW/VHFSTATS^Show the VHF DX Statistics for last 31 days Show the VHF DX spots breakdown by band for the last 31 days diff --git a/cmd/show/usdb.pl b/cmd/show/usdb.pl new file mode 100644 index 00000000..8800d5b8 --- /dev/null +++ b/cmd/show/usdb.pl @@ -0,0 +1,29 @@ +# +# show the usdb info for each callsign or prefix entered +# +# $Id$ +# +# Copyright (c) 2002 Dirk Koopman G1TLH +# + +my ($self, $line) = @_; +my @list = split /\s+/, $line; # generate a list of callsigns + +my $l; +my @out; + +return (1, $self->msg('db3', 'FCC USDB')) unless $USDB::present; + +#print "line: $line\n"; +foreach $l (@list) { + $l = uc $l; + my ($city, $state) = USDB::get($l); + if ($state) { + push @out, sprintf "%-7s -> %s, %s", $l, + join (' ', map {ucfirst} split(/\s+/, lc $city)), $state; + } else { + push @out, sprintf "%-7s -> Not Found", $l; + } +} + +return (1, @out); -- 2.43.0