🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
11 messages
11 total messages Started by JoeB Fri, 12 Dec 2003 23:27
[Dialog] Kill Followup Script
#139160
Author: JoeB
Date: Fri, 12 Dec 2003 23:27
132 lines
5771 bytes
Hi all.

Please find attached my first attempt at Dialog scripting. (Please don't
laugh.)

In certain groups, a perfectly normal thread will be going on, until a
well-known troll posts a response. From that point on the thread
degenerates into ad hominems and a tedious slanging match. I have no
interest in the thread from that point: this script is intended to address
that.

What the script does is check each message's author against a (user
defined) list of posters. If the posting is from one such, the message id
is compared against a list of already-banned ids, and added if it does not
already exist: the message is then killed.

Each message's references are then checked against the banned ids, and if
they contain the id, the message is again killed.

The practical upshot is to kill all posts, and followups to those posts, by
particular authors, without nuking the whole thread.

Now the disclaimers: I'm very new to Dialog and Pascal - I heard about it a
week ago - and I'm no programmer. The script is basically a Lego job,
bolted together from concepts lifted wholesale from the existing body of
Dialog scripts. I realise that the script is crude, and could do with
improvement: to that end I would be delighted for any input the more
skilled regulars could provide... the more the merrier :-)

Usage:

1) Create two blank text files as defined in the Const section.
2) Cut and paste the *entire* From: line into the killauth text file. (The
whole string - for example "RandomTroll" <randomtroll@foo.org> - is
required, not just the nickname.
3) Assign the script below to the OnXOver event, compile, run and save.

<script starts>

program OnXover; 
// OnXover script to identify and kill posts by banned authors, and
followups to
// those posts

// set these variables as the paths to the working files - create empty
text files in these locations
const
  KillAuthFile = 'c:\killauth.txt'; // file of Froms to kill - must contain
full string, not just name
  KillMsgIdFile = 'c:\killmsg.txt'; // autogenerated file of msgids to kill   
  
function CheckAuth(AuthName : string): boolean;
// check if author is to be killed
VAR 
   AuthList : TStringList; 
begin
   AuthList := TStringList.Create();
   Authlist.LoadFromFile(KillAuthFile);
   Result := authlist.indexof(AuthName) > -1
   AuthList.free;
end;

function CheckKnownId(KnownId : string): boolean;
// check to see if we already knowthis msgid so we don't add it again
VAR 
   KnownIdList : TStringList; 
begin
   KnownIdList := TStringList.Create();
   KnownIdlist.LoadFromFile(KillMsgIdFile);
   Result := KnownIdlist.indexof(KnownId) > -1 
   KnownIdList.free;
end;  

procedure AddNewId(NewId: string);
// add a new msgid to the kill list 
VAR 
   IdList: TStringList;  
begin
   IdList := TStringList.Create();
   IdList.LoadFromFile(KillMsgIdFile);
   IdList.Add(NewId);
   IdList.SaveToFile(KillMsgIdFile);
   IdList.Free;
end;



procedure OnXover(Var XoverData:TXoverData);
var 
   Msglist: TStringList; 
   n: integer;         
begin // check to see if we kill this author                 
   if checkauth(xoverdata.from) then
      // if we do, check to see if this is a new msgid 
       begin
         if not checkknownid(xoverdata.msgid) then // if it's new, add it 
         addnewid(xoverdata.msgid);
         xoverdata.deleted := true; // and kill the parent article  
       end;
      // if it's not a killed author, check to see if it's a followup   
   msglist := TStringList.Create();     
   msglist.LoadFromFile(KillMsgIdFile);   
   for n := 0 to msglist.count - 1 do 
   begin
      IF pos(msglist[n],XoverData.References)>0
      THEN xoverdata.deleted := true; // and kill the followup
   end
   msglist.free;    
end;   

begin
end.

<script ends>

Things I think that are wrong with the script:
1) There's probably a setting in Dialog to do exactly this already :-)
2) The whole From: string is required, which does not handle morphs very
well. But I can't figure out how to get the NNTP-Posting-Host from the
initial OnXOver event. Or maybe some sort of regex?
3) I've no idea what impact it has on performance when downloading headers.
4) I believe I should have used try/finally contructions, but I couldn't
get the syntax right.
5) The KillMsgIdFile will probably have to be cleared out periodically.
6) Some poster's newsreaders appear to mangle the References: header, so
the script is not 100% effective. But it helps :-)

Hope this is of use to some people, and, as I said, I would greatly
appreciate any comments that would improve (a) the script and (b) my
scripting.

JoeB
Re: [Dialog] Kill Followup Script
#139246
Author: paul j.
Date: Sun, 14 Dec 2003 00:06
141 lines
6973 bytes
On Fri, 12 Dec 2003 23:27:07 +0000, JoeB wrote:

> Hi all.
> 
> Please find attached my first attempt at Dialog scripting. (Please don't
> laugh.)
> 
> In certain groups, a perfectly normal thread will be going on, until a
> well-known troll posts a response. From that point on the thread
> degenerates into ad hominems and a tedious slanging match. I have no
> interest in the thread from that point: this script is intended to address
> that.
> 
> What the script does is check each message's author against a (user
> defined) list of posters. If the posting is from one such, the message id
> is compared against a list of already-banned ids, and added if it does not
> already exist: the message is then killed.
> 
> Each message's references are then checked against the banned ids, and if
> they contain the id, the message is again killed.
> 
> The practical upshot is to kill all posts, and followups to those posts, by
> particular authors, without nuking the whole thread.
> 
> Now the disclaimers: I'm very new to Dialog and Pascal - I heard about it a
> week ago - and I'm no programmer. The script is basically a Lego job,
> bolted together from concepts lifted wholesale from the existing body of
> Dialog scripts. I realise that the script is crude, and could do with
> improvement: to that end I would be delighted for any input the more
> skilled regulars could provide... the more the merrier :-)
> 
> Usage:
> 
> 1) Create two blank text files as defined in the Const section.
> 2) Cut and paste the *entire* From: line into the killauth text file. (The
> whole string - for example "RandomTroll" <randomtroll@foo.org> - is
> required, not just the nickname.
> 3) Assign the script below to the OnXOver event, compile, run and save.
> 
> <script starts>
> 
> program OnXover; 
> // OnXover script to identify and kill posts by banned authors, and
> followups to
> // those posts
> 
> // set these variables as the paths to the working files - create empty
> text files in these locations
> const
>   KillAuthFile = 'c:\killauth.txt'; // file of Froms to kill - must contain
> full string, not just name
>   KillMsgIdFile = 'c:\killmsg.txt'; // autogenerated file of msgids to kill   
>   
> function CheckAuth(AuthName : string): boolean;
> // check if author is to be killed
> VAR 
>    AuthList : TStringList; 
> begin
>    AuthList := TStringList.Create();
>    Authlist.LoadFromFile(KillAuthFile);
>    Result := authlist.indexof(AuthName) > -1
>    AuthList.free;
> end;
> 
> function CheckKnownId(KnownId : string): boolean;
> // check to see if we already knowthis msgid so we don't add it again
> VAR 
>    KnownIdList : TStringList; 
> begin
>    KnownIdList := TStringList.Create();
>    KnownIdlist.LoadFromFile(KillMsgIdFile);
>    Result := KnownIdlist.indexof(KnownId) > -1 
>    KnownIdList.free;
> end;  
> 
> procedure AddNewId(NewId: string);
> // add a new msgid to the kill list 
> VAR 
>    IdList: TStringList;  
> begin
>    IdList := TStringList.Create();
>    IdList.LoadFromFile(KillMsgIdFile);
>    IdList.Add(NewId);
>    IdList.SaveToFile(KillMsgIdFile);
>    IdList.Free;
> end;
> 
> 
> 
> procedure OnXover(Var XoverData:TXoverData);
> var 
>    Msglist: TStringList; 
>    n: integer;         
> begin // check to see if we kill this author                 
>    if checkauth(xoverdata.from) then
>       // if we do, check to see if this is a new msgid 
>        begin
>          if not checkknownid(xoverdata.msgid) then // if it's new, add it 
>          addnewid(xoverdata.msgid);
>          xoverdata.deleted := true; // and kill the parent article  
>        end;
>       // if it's not a killed author, check to see if it's a followup   
>    msglist := TStringList.Create();     
>    msglist.LoadFromFile(KillMsgIdFile);   
>    for n := 0 to msglist.count - 1 do 
>    begin
>       IF pos(msglist[n],XoverData.References)>0
>       THEN xoverdata.deleted := true; // and kill the followup
>    end
>    msglist.free;    
> end;   
> 
> begin
> end.
> 
> <script ends>
> 
> Things I think that are wrong with the script:
> 1) There's probably a setting in Dialog to do exactly this already :-)
> 2) The whole From: string is required, which does not handle morphs very
> well. But I can't figure out how to get the NNTP-Posting-Host from the
> initial OnXOver event. Or maybe some sort of regex?
> 3) I've no idea what impact it has on performance when downloading headers.
> 4) I believe I should have used try/finally contructions, but I couldn't
> get the syntax right.
> 5) The KillMsgIdFile will probably have to be cleared out periodically.
> 6) Some poster's newsreaders appear to mangle the References: header, so
> the script is not 100% effective. But it helps :-)
> 
> Hope this is of use to some people, and, as I said, I would greatly
> appreciate any comments that would improve (a) the script and (b) my
> scripting.
> 
> JoeB

So this will basically kill followups to people I deem unworthy of reading?
:)
-- 
Before you open your mouth to speak, please make sure it's an improvement
upon the silence.
-----= check my headers for valid email address =-----  
Re: [Dialog] Kill Followup Script
#139257
Author: Richard Wakeford
Date: Sun, 14 Dec 2003 03:05
9 lines
1431 bytes
On Sun, 14 Dec 2003 00:06:56 GMT, paul j. wrote:

> So this will basically kill followups to people I deem unworthy of reading?
> :)

You mean people who quote a whole long message, complete with sig, to
answer with just one line! ;-)
-- 
Richard
Re: [Dialog] Kill Followup Script
#139270
Author: Enrico Bauer
Date: Sun, 14 Dec 2003 09:19
8 lines
1692 bytes
14.12.2003 01:06:56, *paul j.*:
>> Hope this is of use to some people, and, as I said, I would greatly
>> appreciate any comments that would improve (a) the script and (b) my
>> scripting.
> So this will basically kill followups to people I deem unworthy of reading?
> :)

Yes, like stupid fullquoters.
Re: [Dialog] Kill Followup Script
#139274
Author: JoeB
Date: Sun, 14 Dec 2003 12:59
9 lines
1403 bytes
On Sun, 14 Dec 2003 00:06:56 GMT, paul j. wrote:
 
> So this will basically kill followups to people I deem unworthy of reading?
> :)

That's the plan. (It kills the original message from the unworthy person as
well, so you don't see that either.)

JoeB
Re: [Dialog] Kill Followup Script
#139361
Author: paul j.
Date: Mon, 15 Dec 2003 21:21
17 lines
2339 bytes
On Sun, 14 Dec 2003 12:59:39 +0000, JoeB wrote:

> On Sun, 14 Dec 2003 00:06:56 GMT, paul j. wrote:
>  
>> So this will basically kill followups to people I deem unworthy of reading?
>> :)
> 
> That's the plan. (It kills the original message from the unworthy person as
> well, so you don't see that either.)
> 
> JoeB

Great!  Thanks much!
-- 
Before you open your mouth to speak, please make sure it's an improvement
upon the silence.
-----= check my headers for valid email address =-----  
Re: [Dialog] Kill Followup Script
#139373
Author: paul j.
Date: Tue, 16 Dec 2003 02:15
19 lines
2550 bytes
On Sun, 14 Dec 2003 03:05:59 +0000, Richard Wakeford wrote:

> On Sun, 14 Dec 2003 00:06:56 GMT, paul j. wrote:
> 
>> So this will basically kill followups to people I deem unworthy of reading?
>> :)
> 
> You mean people who quote a whole long message, complete with sig, to
> answer with just one line! ;-)

My fault...I'm usually a stickler on proper posting.  I think I just got
overly excited about the script as I have been looking for something like
this for a long time.

Again...my apologies. :)
-- 
Before you open your mouth to speak, please make sure it's an improvement
upon the silence.
-----= check my headers for valid email address =-----  
Re: [Dialog] Kill Followup Script
#139381
Author: Wrinklie One
Date: Tue, 16 Dec 2003 09:03
21 lines
2194 bytes
On Mon, 15 Dec 2003 21:21:35 GMT, paul j. sauntered in and penned :

> On Sun, 14 Dec 2003 12:59:39 +0000, JoeB wrote:
> 
>> On Sun, 14 Dec 2003 00:06:56 GMT, paul j. wrote:
>>  
>>> So this will basically kill followups to people I deem unworthy of reading?
>>> :)
>> 
>> That's the plan. (It kills the original message from the unworthy person as
>> well, so you don't see that either.)
>> 
>> JoeB
> 
> Great!  Thanks much!

Have you implemented it and does it do what it says on the tin ? :-)
-- 
One man's meat is another man's poison.
Sauce for the goose is sauce for the gander.
Wrinklie
Re: [Dialog] Kill Followup Script
#139388
Author: JoeB
Date: Tue, 16 Dec 2003 10:51
7 lines
1465 bytes
On Mon, 15 Dec 2003 21:21:35 GMT, paul j. wrote:

> Great!  Thanks much!

You're welcome. I'd be interested to know how you get on with it...

JoeB
Re: [Dialog] Kill Followup Script
#139452
Author: paul j.
Date: Wed, 17 Dec 2003 03:05
21 lines
2581 bytes
On Tue, 16 Dec 2003 10:51:39 +0000, JoeB wrote:

> On Mon, 15 Dec 2003 21:21:35 GMT, paul j. wrote:
> 
>> Great!  Thanks much!
> 
> You're welcome. I'd be interested to know how you get on with it...
> 
> JoeB

I can't seem to get it to work.

Does it need to have the From field from the "raw message" output or the
>From field as you have it defined in your original post?

I added someone to the killauth.txt file and redownloaded all the headers
in a group and the thread was still there.
-- 
Before you open your mouth to speak, please make sure it's an improvement
upon the silence.
-----= check my headers for valid email address =-----  
Re: [Dialog] Kill Followup Script
#139480
Author: JoeB
Date: Wed, 17 Dec 2003 11:49
28 lines
2288 bytes
On Wed, 17 Dec 2003 03:05:57 GMT, paul j. wrote:

> On Tue, 16 Dec 2003 10:51:39 +0000, JoeB wrote:
> 
>> On Mon, 15 Dec 2003 21:21:35 GMT, paul j. wrote:
>> 
>>> Great!  Thanks much!
>> 
>> You're welcome. I'd be interested to know how you get on with it...
>> 
>> JoeB
> 
> I can't seem to get it to work.
> 
> Does it need to have the From field from the "raw message" output or the
> From field as you have it defined in your original post?
> 
> I added someone to the killauth.txt file and redownloaded all the headers
> in a group and the thread was still there.

It needs the From field as displayed in the rew message view, as you say.
Did you create an empty killmsg.txt as well?

Also, I'm not sure what you mean by redownloading the headers - what I did
was unsubscribe from the group, deleting all messages, then re-subscribe
again...

JoeB
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