+10Sep19=======================================================================
+1. Improve DXSql database filtering to exclude most via <locator> type
+ reports.
14Jul18=======================================================================
1. Add CTY-2808 prefixes + wpxloc.raw
23Jan18=======================================================================
--- /dev/null
+#
+# load the QSL file after changing it
+#
+my $self = shift;
+return (1, $self->msg('e5')) if $self->priv < 9;
+my $r = QSL::init(1);
+return (1, $r ? $self->msg('ok') : $self->msg('e2', "$!"));
+++ /dev/null
-#
-# load the QSL file after changing it
-#
-my $self = shift;
-return (1, $self->msg('e5')) if $self->priv < 9;
-my $r = QSL::init(1);
-return (1, $r ? $self->msg('ok') : $self->msg('e2', "$!"));
# does it look like a qra locator?
sub is_qra
{
- return $_[0] =~ /^[A-Ra-r][A-Ra-r]\d\d[A-Xa-x][A-Xa-x]$/;
+ return unless length $_[0] == 4 || length $_[0] == 6;
+ return $_[0] =~ /^[A-Ra-r][A-Ra-r]\d\d(?:[A-Xa-x][A-Xa-x])?$/;
}
# does it look like a valid lat/long
use DXDebug;
use Prefix;
-use vars qw($qslfn $dbm);
+use vars qw($qslfn $dbm $maxentries);
$qslfn = 'qsl';
$dbm = undef;
+$maxentries = 50;
sub init
{
}
import Storable qw(nfreeze freeze thaw);
my %u;
+ undef $dbm;
if ($mode) {
$dbm = tie (%u, 'DB_File', $ufn, O_CREAT|O_RDWR, 0666, $DB_BTREE) or confess "can't open qsl file: $qslfn ($!)";
} else {
my $t = shift;
my $by = shift;
my $changed;
-
+
+ return unless length $line && $line =~ /\b(?:QSL|VIA)\b/i;
foreach my $man (split /\b/, uc $line) {
my $tok;
- if (is_callsign($man)) {
+ if (is_callsign($man) && !is_qra($man)) {
my @pre = Prefix::extract($man);
$tok = $man if @pre && $pre[0] ne 'Q';
} elsif ($man =~ /^BUR/) {
$tok = 'BUREAU';
+ } elsif ($man =~ /^LOTW/) {
+ $tok = 'LOTW';
} elsif ($man eq 'HC' || $man =~ /^HOM/ || $man =~ /^DIR/) {
$tok = 'HOME CALL';
} elsif ($man =~ /^QRZ/) {
$tok = 'QRZ.com';
+ } else {
+ next;
}
if ($tok) {
my ($r) = grep {$_->[0] eq $tok} @{$self->[1]};
unshift @{$self->[1]}, $r;
$changed++;
}
+ # prune the number of entries
+ pop @{$self->[1]} while (@{$self->[1]} > $maxentries);
}
}
$self->put if $changed;