X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fdx.pl;h=a219c387b178556cd413ef2cbe19469f3b2b3295;hb=fc8ec20708a70b6297d3c8b8c35b1086c6018cbb;hp=b513c614495ac40a13dc00854903da5e4a8194e0;hpb=fa7bdf4c84e162d43cb6ba5b43f89cc230ebcc30;p=spider.git diff --git a/cmd/show/dx.pl b/cmd/show/dx.pl index b513c614..a219c387 100644 --- a/cmd/show/dx.pl +++ b/cmd/show/dx.pl @@ -29,6 +29,8 @@ my $itu; my $byitu; my $fromdxcc = 0; my $exact; +my $origin; +my $ip; my ($doqsl, $doiota, $doqra, $dofilter); my $usesql = $main::dbh && $Spot::use_db_for_search; @@ -85,6 +87,17 @@ while ($f = shift @list) { # next field dbg "got info $info" if isdbg('shdx'); next; } + if (lc $f eq 'origin' && $list[0]) { + $origin = uc shift @list; + dbg "got origin $origin" if isdbg('shdx'); + next; + } + if (lc $f eq 'ip' && $list[0]) { + $ip = shift @list; + dbg "got ip $ip" if isdbg('shdx'); + next; + } + if ((lc $f eq 'spotter' || lc $f eq 'by') && $list[0]) { $spotter = uc shift @list; if ($list[0] && lc $list[0] eq 'dxcc') { @@ -150,7 +163,24 @@ while ($f = shift @list) { # next field #$DB::single = 1; -# first deal with the prefix +# check origin +if ($origin) { + $expr .= ' && ' if $expr; + $expr .= "\$f7 eq '$origin'"; + $hint .= ' && ' if $hint; + $hint .= "m{$origin}"; +} + +# check (any) ip address +if ($ip) { + $expr .= ' && ' if $expr; + $expr .= "\$f14 && \$f14 =~ m{^$ip}"; + $hint .= ' && ' if $hint; + $ip =~ s/\./\\./g; # IPV4 + $hint .= "m{$ip}"; +} + +# deal with the prefix if ($pre) { my @ans; @@ -218,7 +248,7 @@ if (@freq) { # any info if ($info) { $expr .= ' && ' if $expr; - $info =~ s{(.)}{"\Q$1"}ge; +# $info =~ s{(.)}{"\Q$1"}ge; $expr .= "\$f3 =~ m{$info}i"; $hint .= ' && ' if $hint; $hint .= "m{$info}i"; @@ -382,6 +412,11 @@ if ($doqra) { $hint .= "m{$doqra}io"; } +$from ||= ''; +$to ||= ''; +$fromday ||= ''; +$today ||= ''; + dbg "expr: $expr from: $from to: $to fromday: $fromday today: $today" if isdbg('sh/dx'); # now do the search