remove space from dupe checking
[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
17 use vars qw(%dup $duplth $dupage);
18
19 $duplth = 60;                                   # the length of text to use in the deduping
20 $dupage = 5*24*3600;                    # the length of time to hold spot dups
21
22 # enter the spot for dup checking and return true if it is already a dup
23 sub dup
24 {
25         my ($call, $to, $text) = @_; 
26
27         chomp $text;
28         unpad($text);
29         $text =~ s/[^a-zA-Z0-9]//g;
30         $text = substr($text, 0, $duplth) if length $text > $duplth; 
31         my $dupkey = "A$to|$text";
32         return DXDupe::check($dupkey, $main::systime + $dupage);
33 }
34
35 sub listdups
36 {
37         return DXDupe::listdups('A', $dupage, @_);
38 }
39
40
41 1; 
42