| 1 | # News::GnusFilter: based on tchrist's msgchk | ||
| 2 | # reworked for Gnus by Joe Schaefer <joe+cpan@sunstarsys.com> | ||
| 3 | # $Id: GnusFilter.pm,v 1.6 2001/09/16 04:39:55 joe Exp $ | ||
| 4 | |||
| 5 | package News::GnusFilter; | ||
| 6 | $VERSION = '0.56'; | ||
| 7 | |||
| 8 | use v5.22; | ||
| 9 | use strict; | ||
| 10 | |||
| 11 | =head1 NAME | ||
| 12 | |||
| 13 | News::GnusFilter - package for scoring usenet posts | ||
| 14 | |||
| 15 | Version: 0.55 ($Revision: 1.6 $) | ||
| 16 | |||
| 17 | =head1 SYNOPSIS | ||
| 18 | |||
| 19 | # I<~/.gnusfilter> - scoring script | ||
| 20 | |||
| 21 | require 5.006; | ||
| 22 | use strict; | ||
| 23 | use News::GnusFilter qw/:tests groan references NSLOOKUP VERBOSE/; | ||
| 24 | |||
| 25 | NSLOOKUP = ""; # disables nslookups for bogus_address test | ||
| 26 | VERBOSE = 1; # noisier output for debugging | ||
| 27 | |||
| 28 | my $goof = News::GnusFilter->set_score( { | ||
| 29 | rethreaded => 80, | ||
| 30 | no_context => 60, | ||
| 31 | } ); | ||
| 32 | |||
| 33 | # standard tests - see B<MESSAGE TESTS> for details | ||
| 34 | |||
| 35 | missing_headers; | ||
| 36 | bogus_address; | ||
| 37 | annoying_subject; | ||
| 38 | cross_post; | ||
| 39 | mimes; | ||
| 40 | lines_too_long; | ||
| 41 | control_characters; | ||
| 42 | miswrapped; | ||
| 43 | misattribution; | ||
| 44 | jeopardy_quoted; | ||
| 45 | check_quotes; # runs multiple tests on quoted paragraphs | ||
| 46 | bad_signature; | ||
| 47 | |||
| 48 | # custom tests - see B<WRITING HEADERS and SCORING> | ||
| 49 | |||
| 50 | if (check_quotes and not references) { | ||
| 51 | $goof->{rethreaded} = groan "Callously rethreaded"; | ||
| 52 | } | ||
| 53 | |||
| 54 | if (references and not check_quotes) { | ||
| 55 | $goof->{no_context} = groan "Missing context"; | ||
| 56 | } | ||
| 57 | |||
| 58 | __END__ |