🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
5 messages
5 total messages Started by Klaatu Fri, 09 Dec 2005 19:27
Xnews: Kill initial poster and all followups
#177355
Author: Klaatu
Date: Fri, 09 Dec 2005 19:27
12 lines
1559 bytes
There's several groups I follow where certain trolls regularly post. They
always start a thread but never reply after that. Many people respond to
the troll, of course, which leads to a lot of garbage posts I'd rather not
see.

Does Xnews have a way to establish a rule that would allow me to
automatically kill the entire thread based on the person who started it?
If so, what would such a rule look like? TIA

-- 
My girlfriend said "Its me or that computer"
God - I'm gonna miss her
Re: Xnews: Kill initial poster and all followups
#177359
Author: »Q«
Date: Fri, 09 Dec 2005 20:18
29 lines
2368 bytes
Klaatu <klaatu@nospam.invalid> wrote in
<news:Xns9727748998561klaatunospaminvalid@127.0.0.1>:

> There's several groups I follow where certain trolls regularly
> post. They always start a thread but never reply after that. Many
> people respond to the troll, of course, which leads to a lot of
> garbage posts I'd rather not see.
>
> Does Xnews have a way to establish a rule that would allow me to
> automatically kill the entire thread based on the person who
> started it? If so, what would such a rule look like? TIA

If there is something unique in the OP's Message-ID header, you can use
that, since his MID will appear in the References header of everything
downthread.

   Score:: =-9999
      Message-ID: uniquepartofmid
      References: uniquepartofmid

If there's nothing unique in the MID, the best you can do in Xnews is
flag the troll's posts then kill the thread every time you see one.
Someone wrote a script to do that automagically once, but I've lost
track of it.

-- 
»Q«
     links to Xnews resources:
     <http://www.cotse.net/users/putty/intro.htm>
Re: Xnews: Kill initial poster and all followups
#177361
Author: DC
Date: Fri, 09 Dec 2005 20:22
23 lines
2234 bytes
Klaatu wrote:
> There's several groups I follow where certain trolls regularly post. They
> always start a thread but never reply after that. Many people respond to
> the troll, of course, which leads to a lot of garbage posts I'd rather not
> see.

> Does Xnews have a way to establish a rule that would allow me to
> automatically kill the entire thread based on the person who started it?
> If so, what would such a rule look like? TIA

Create a score based on the M-ID and References headers.

Score:: =-9999
Message-ID: klaatunospaminvalid@127.0.0.1
References: klaatunospaminvalid@127.0.0.1

Use only the constant, provided that there is one.

-- 
DC                                   Linux RU #1000111011000111001

Viruses, Instability, Spyware, Trojans, Adware -- Pre-order today!
     -= http://www.microsoft.com/windowsvista/default.mspx =-
Re: Xnews: Kill initial poster and all followups
#177365
Author: Alan Ford
Date: Fri, 09 Dec 2005 21:30
38 lines
2529 bytes
On /ven 09 dic 2005 09:18:15p/, *»Q«* wrote:

> If there's nothing unique in the MID, the best you can do in Xnews
> is flag the troll's posts then kill the thread every time you see
> one. Someone wrote a script to do that automagically once, but
> I've lost track of it.

If you give up to Ctrl+D (Goto Google News Search), put in xnews.ini:

    DejaPage=file:///D:/Xnews/script.au3

Download AutoIt3:

    http://www.autoitscript.com/autoit3/

and associate .au3 extension to it.

If for "Add to score file" function is associated the keyboard shorcut 
`S' (for example), the script is:

----- 8< ----- script.au3 ----- 8< -----
If ProcessExists ( "xnews.exe" ) Then
  WinActivate ( "Xnews" )
  Send ( "s" )
  sleep(200)
  Send ( "f" )
  Send ( "a" )
EndIf
Exit
----- 8< ----- 8< -----

Bye.

-- 
 __    _  _  |    |_/    .-.      .-.   |_|          WWW   \o/   \V/
(  )  ( \/ ) | -._(^}   /(")\  W '(")'  [`)__,~      (')   (')   (')
/ (_/\/ \/ \ |  (__)   / /_\ \(O)`_/|    (___)     %-J_| $-J_| &-J_|
\____/\_)(_/ |  |\|\    (/_\) (_) | |    /\ /\      _/_|  _/_|  _/_|
Re: Xnews: Kill initial poster and all followups
#177371
Author: Mike Yetto
Date: Fri, 09 Dec 2005 23:42
241 lines
6720 bytes
It was April the forty-first, being a quadruple leap year,
when »Q« wrote...

> If there's nothing unique in the MID, the best you can do in
> Xnews is flag the troll's posts then kill the thread every time
> you see one. Someone wrote a script to do that automagically
> once, but I've lost track of it.
> 
This what you're looking for?

You'll need to "unwrap" the lines properly, and I think I made a 
modification or two, but don't remember what they were.  There's an 
ini file to go with it.

killrefs.pl
====
#!/usr/bin/perl -w

use strict;

use News::NNTPClient;
use File::Basename;

my ($debug, $ini_file, $server_name, $user_name, $password, $newsrc, 
$old_score_file, $expire_in_days, $score_value, @bad_from, 
$new_score_file, $backup_score_file, @score_file, $group, $c, $first, 
$last, $rest, $last_read, $article, $message_id, $from, $bad_from, 
@message_ids, $mt, $mday, $mon, $year, $found, $score_file, $mid);
my $already_printed = 0;

my ($basename, $path, $ftype) = fileparse($0, ".pl");

# 0 - print nothing
# 1 - print results going out
# 2 - print both input and output

$debug = 1;

if ( $#ARGV > -1 )
{
    $ini_file = $ARGV[0];
}
else
{
    $ini_file = $path . "killrefs.ini";
}

open(INI_FILE, $ini_file) or die "Can't open $ini_file";

chomp($server_name = <INI_FILE>);
chomp($user_name = <INI_FILE>);
chomp($password = <INI_FILE>);
chomp($newsrc = <INI_FILE>);
chomp($old_score_file = <INI_FILE>);
chomp($expire_in_days = <INI_FILE>);
chomp($score_value = <INI_FILE>);

while (<INI_FILE>)
{
    chomp;
    push @bad_from, $_;
}

$c = new News::NNTPClient($server_name);

$c->authinfo($user_name, $password) or die "Can't connect to 
$server_name as $user_name";

#print "Server:\t $server_name\n";
#print $c->list('overview.fmt');

$new_score_file = $old_score_file . "_new";
$backup_score_file = $old_score_file . "_bak";

open(NEWSRC, $newsrc) or die "Can't open $newsrc";
open(OLD_SCORE_FILE, $old_score_file) or die "Can't open 
$old_score_file";

@score_file = <OLD_SCORE_FILE>;

close OLD_SCORE_FILE;

while (<NEWSRC>)
{
    next if ! /:/;
    next if /:$/;

    chomp;

    ( $group, $rest ) = split(':');

    ( $first, $rest ) = split('-', $rest);

    ( $last_read, $rest ) = split('/', $rest);

    ( $last_read, $rest ) = split(',', $last_read);

    ( $first, $last ) = ( $c->group($group) );

    $debug > 1 && print "$group $first $last_read $last\n";

    for $from ($c->xhdr("From", $last_read, $last))
    {
        $debug > 1 && print "$from\n";

        for $bad_from (@bad_from)
        {
            if ( $from =~ /$bad_from/ )
            {
                ( $article, $rest ) = split(' ', $from);

                ( $message_id ) = $c->xhdr("Message-ID", $article);

                chomp $message_id;

                $message_id =~ s/^.*<(.*)>$/$1/;

                $debug > 1 && print $message_id, "\n";

                push @message_ids, $message_id;

                #it's been found, stop looking
                last;
            }
        }
    }
}

$debug && print "Done reading\n";

if ( $#message_ids > -1 )
{
    open(NEW_SCORE_FILE, ">$new_score_file") or die "Can't open 
$new_score_file";

    $mt = time() + $expire_in_days * 86400;

#    (undef,undef,undef,$mday,$mon,$year,undef,undef) = gmtime($mt);
    (undef,undef,undef,$mday,$mon,$year,undef,undef) = 
localtime($mt);

    $year += 1900;
    $mon += 1;

    $found = 0;

    for $score_file (@score_file)
    {
        print NEW_SCORE_FILE $score_file;

        next if $found;

        next if ! ( $score_file =~ /^\[\.\]/ );

        $found = 1;

        print_message_ids();
    }

    if ( not $found )
    {
        print NEW_SCORE_FILE "\n\[\.\]\n";

        print_message_ids();
    }

    close NEW_SCORE_FILE;

    rename $old_score_file, $backup_score_file or die "Can't rename 
$old_score_file to $backup_score_file";
    rename $new_score_file, $old_score_file or die "Can't rename 
$new_score_file to $old_score_file";
}
else
{
    $debug && print "No message ids this time!\n";
}

sub print_message_ids
{
    for $mid (@message_ids)
    {
        $mid =~ s/\$/\\\$/g;
        $mid =~ s/\./\\./g;
        $mid =~ s/\-/\\-/g;

        $debug && print $mid, "!\n";

        if ( not $already_printed) {
	    	print NEW_SCORE_FILE "\n    % generated by KillRefs.pl\n    
Score:: $score_value\n        Expires: $mon/$mday/$year\n";
	    	$already_printed = 1;
    		}

    	print NEW_SCORE_FILE "        References: <$mid>\n";
    }
}

====

killrefs.ini

====
news.readfreenews.net
<uid> if any
<password> if any
?:\XNews\ReadFreeNews.newsrc
?:\\Xnews\\score.ini
10
-9999
Leythos
rmholt
Casner
Ragnar Suomi
java@evij.com
jkb@yeahright.com
none@no.way
Bob McConnell
rmcconne@NOSPAM.lightlink.com
Hal.Turner@HalTurnerShow.com
Alan Connor
Georg Ten Brouck
hiawatha@efn.org
galen thurber
paul kneisel
rose marie holt
Peter H.M. Brooks
Dusty Dahmer
Ed Conrad
edconrad@verizon.net
Danny@DD.net
====

    	Mike "don't use it much though" Yetto
-- 
myetto1 at nycap dot rr dot com
Never trust anyone whose suit is nicer than your own.
    - Ferengi Rule of Acquisition #47.


Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads