added show/usdb
authorminima <minima>
Mon, 14 Oct 2002 13:18:28 +0000 (13:18 +0000)
committerminima <minima>
Mon, 14 Oct 2002 13:18:28 +0000 (13:18 +0000)
Changes
cmd/Commands_en.hlp
cmd/show/usdb.pl [new file with mode: 0644]

diff --git a/Changes b/Changes
index 2f6b6aac6b4d5f2f1b980ddd071c7d65ee1b8960..524b2ade085ea0cdf60d3a53ce021b2a1bb338de 100644 (file)
--- 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
index eca6dacb8e46479ee8a30a0c33d5e770ffdeafdd..51d1622ecf7ec80ce7df31e53539eab820bb8cd1 100644 (file)
@@ -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 (file)
index 0000000..8800d5b
--- /dev/null
@@ -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);