fix a talk bug for t xxx > yyy
[spider.git] / perl / AnnTalk.pm
1 #
2 # Announce and Talk Handling routines
3 #
4 # Copyright (c) 2000 Dirk Koopman
5 #
6 # $Id$
7 #
8
9 package AnnTalk;
10
11 use strict;
12
13 use DXUtil;
14 use DXDebug;
15 use DXDupe;
16 use DXVars;
17
18 use vars qw(%dup $duplth $dupage);
19
20 $duplth = 60;                                   # the length of text to use in the deduping
21 $dupage = 5*24*3600;                    # the length of time to hold spot dups
22
23
24 # enter the spot for dup checking and return true if it is already a dup
25 sub dup
26 {
27         my ($call, $to, $text) = @_; 
28
29         chomp $text;
30         unpad($text);
31         $text =~ s/[^a-zA-Z0-9]//g;
32         $text = substr($text, 0, $duplth) if length $text > $duplth; 
33         my $dupkey = "A$to|\L$text";
34         return DXDupe::check($dupkey, $main::systime + $dupage);
35 }
36
37 sub listdups
38 {
39         return DXDupe::listdups('A', $dupage, @_);
40 }
41
42
43 1; 
44