🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #237505

Re: [Dialog] Filtering by post body

#237505
From: Rom
Date: Thu, 22 Oct 2009 05:56
44 lines
2518 bytes
On Wed, 21 Oct 2009 22:55:35 +0200, Eddie wrote:

> In Dilaog, is it possible to filter out posts by content of the post body?

Yes, with a script.

> There is an increasing number of pyramidal scheme posts plaguing hr.*
> groups and I would like to filter them out and the only way is to match to
> certain words in post body.

Bodies must be downloaded for the group(s) for body filtering/scoring:
Group menu > Default/Selected group options > Retrieving
[x]Retrieve bodies for all new messages

Here's the script:
<http://www.40tude.com/dialog/wiki/index.php/ScriptXBody> (if
available) or <http://dialog.datalist.org/scripts/ScriptXBody.html>.

Settings > Scripting > Enable scripting (if not already).
Copy script into Settings > Scripting > Scripting... > Event scripts
tab > OnBeforeSavingMessage, then Script > Compile, and Script >
Reload all compiled script in Dialog's main window.

The script adds X-Body1:, X-Body2:, X-Body3: etc. header(s) with the
words (without spaces) of the non-quoted text from the message body so
can score/filter.

Filtering/scoring/actions:
Settings > Scoring and actions > Scoring and action rules tab.

Some examples:
[news.software.readers]
!delete Header "wrongtarget"
!delete Header {^(X-Body[0-9]+?: ).*?keyword.*?}
!ignore,markread Header "someword"
+10 Header "Vista" "Win7"
-10 Header "linux"

Also see these topics in Dialog's Help:
Regular Expressions <dialog.chm::/RegularExpressions.htm>,
Scoring/Actions Syntax <dialog.chm::/scoringactionsyntax.htm>.

-- 
Rom
Technical Details
Message-ID: <urrbwy6e8o1e.1w4nfzt9p59qb.dlg@40tude.net>
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.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
References: <e475v7cphh5v.dlg@eddie.my-fqdn.de>

Show Full Headers
Complete Article Headers
Message-ID: <urrbwy6e8o1e.1w4nfzt9p59qb.dlg@40tude.net>
Subject: Re: [Dialog] Filtering by post body
Date: Thu, 22 Oct 2009 16:56:01 +1100
From: Rom <-@-.invalid>
References: <e475v7cphh5v.dlg@eddie.my-fqdn.de>
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.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
Newsgroups: news.software.readers
Lines: 44
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: individual.net vqbQi1lflNPcYePLwCoeOAezw6ujWfBNKpeb0vowL33QIYntMF
Cancel-Lock: sha1:TIZEEVxg/Z+7kcmCIhkZfELGtBc=
User-Agent: 40tude_Dialog/2.0.15.41
Archive: no
X-No-Archive: yes
X-Original-Bytes: 2285