Article View: news.software.readers
Article #240043Bye-bye, annoying survivalism and rush-limbaugh trolls
From: Ignoramus8009
Date: Tue, 09 Mar 2010 02:32
Date: Tue, 09 Mar 2010 02:32
123 lines
5092 bytes
5092 bytes
There are a few posters, who I personally find extremely annoying
because they never say anything that I am interested in, and yet they
have great skills at stirring the pot among one or several newsgroups,
so then discussions drag in more and more people.
Two examples I can give is Cliff and "Burled Frau".
Killfiling just them accomplishes not so much, because other people
follow up and I see all that crap. Killfiling crossposted newsgroups
is somewhat more effective, but not 100% effective.
I wrote a perl script to address it. It scans selected newsgroups
newsgroup, finds all Message-IDs posted by designated people (listed
in a separate file), and generates a slrn scorefile that killfiles
everything that has those message-IDs in References. So it kills not
only their posts, but all followups to such posts.
The generated scorefile is meant to be included from your main
Scorefile by means of "include" directive.
I am including this script below. I expect to improve it as time goes
on.
######################################################################
#!/usr/bin/perl
#
# Script to killfile trolls and all followups to their posts
#
# Copyright (C) Igor Chudov, 2010
# Released under GNU Public License v3
#
my $usage = "USAGE: $0 --server news.server.com --user username --password pAssWorD [--style (slrn|ids)]";
use strict;
use warnings;
use Getopt::Long;
use News::NNTPClient;
my $server = undef;
my $username = undef;
my $password = undef;
my $trollfile = "$ENV{HOME}/configs/general/usenet-trolls.txt";
my $style = 'slrn';
my $newsgroups = 'rec.crafts.metalworking,alt.machines.cnc';
my $max = 1_000;
GetOptions(
"server=s" => \$server,
"username=s" => \$username,
"password=s" => \$password,
"trollfile=s" => \$trollfile,
"style=s" => \$style,
"max=i" => \$max,
"newsgroups=s" => \$newsgroups,
);
die $usage unless $server && $username && $password;
die $usage unless { slrn => 1, ids => 1 }->{$style};
die "Cannot find file $trollfile" unless -f $trollfile;
my $nntp = new News::NNTPClient( $server )
|| die "Cannot connect to server";
$nntp->authinfo( $username, $password ) || die "Cannot logon to $server";
my $trolls = [];
open( TROLLS, $trollfile ) || die "Cannot open $trollfile: $!.\n";
while( <TROLLS> ) {
next if /^\s*\#/;
next if /^\s*$/;
chomp;
s/\s*\#.*$//;
push @$trolls, $_;
}
close( TROLLS );
my @newsgroups = split( /,/, $newsgroups );
foreach my $ng (@newsgroups) {
my ($start, $end) = $nntp->group( $ng );
$start = $end-$max if $end-$max > $start;
next unless $end > $start;
print STDERR "Analyzing $ng: $start=>$end...\n";
my @fields = qw(numb subj from date mesg refr char line xref);
foreach my $xover ( $nntp->xover( $start, $end ) ) {
my %fields = ();
@fields{@fields} = split /\t/, $xover;
#print "From = $fields{from}, mesg = $fields{mesg}.\n";
my $from = $fields{from};
my $mesg = $fields{mesg};
my $matches = undef;
foreach my $troll (@$trolls) {
my $m = quotemeta( $troll );
if ( $from =~ /$m/ ) {
print STDERR "Message from troll $troll ($from) => $mesg\n";
$matches = 1;
last;
}
}
if ( $matches ) {
$mesg =~ s/^<//;
$mesg =~ s/>$//;
if ( $style eq 'slrn' ) {
print "
[*]
Score: -666
References: $mesg
";
}
}
}
}
exit 0;
Technical Details
Message-ID:
<naqdnQEHz8qoLgjWnZ2dnUVZ_qadnZ2d@giganews.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams3.giganews.com!border1.nntp.ams2.giganews.com!Xl.tags.giganews.com!border2.nntp.ams2.giganews.com!border2.nntp.ams.giganews.com!feeder2.cambriumusenet.nl!feed.tweaknews.nl!postnews.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <naqdnQEHz8qoLgjWnZ2dnUVZ_qadnZ2d@giganews.com> Subject: Bye-bye, annoying survivalism and rush-limbaugh trolls Date: Mon, 08 Mar 2010 20:32:21 -0600 From: Ignoramus8009 <ignoramus8009@NOSPAM.8009.invalid> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams3.giganews.com!border1.nntp.ams2.giganews.com!Xl.tags.giganews.com!border2.nntp.ams2.giganews.com!border2.nntp.ams.giganews.com!feeder2.cambriumusenet.nl!feed.tweaknews.nl!postnews.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 08 Mar 2010 20:32:21 -0600 Newsgroups: rec.crafts.metalworking,news.software.readers User-Agent: slrn/pre1.0.0-11 (Linux) Lines: 123 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-l4EPZMQsgeU7txU4TB2SDCvIeE2YGnIjmPyg+wInsvJtLEyfooCZKikUPeJTwagD+oDkDlbWHl6kW22!rnMzBYMhVJ2yGNscARFgOB3oDhxKJCF8A7yoM2Y+NmX1H4kkoDG7Ct3jLxwU9A0d85/Fl7DQA2y+ X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 4905