🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
5 messages
5 total messages Started by Tech Zero Sat, 05 Jun 2004 10:10
[Xnews] HELP - Selectivly allowing cross-posts?
#149401
Author: Tech Zero
Date: Sat, 05 Jun 2004 10:10
33 lines
2374 bytes
Yes...  Even I occasionally need some help...

Some time ago I an additional feed-server to my Dnews set-up, and as an 
"expected" side affect (read: "a few a day was expected").  But now I 
have more Usenet-SPAM then and sane critter should.

Normally I'd just dump the "sour server", but I can't beat it's post 
completeness, and the filtered servers "acting-up" from time to time, 
and occasional misplace good posts...

So I did what I've done before, and spent the last few days (read: 
sleepless nights) beefing up my Score.ini, which lead me to my 
question:  Is there a way to selective allow cross-posts to only 
certain groups in a single line entry?

One of the entries I'm using:
  [^alt\.fan\.dragons$]
  Score: -2700
     Xref: (.*:){2}
     ~Xref: furry|magick|mythology

I'd like to drop it to a single "Xref" test, so I can test other 
entries if first condition is false, but I haven't had any luck yet.

I suspect it has something to do with PCRE "Look ahead/behind 
assertion", but I've just started use those Regex entries, and the 
first few tests (read: dozen of so) didn't work as expected.

The rest of the new entries are online, and any suggestions are 
welcome:  http://www.dragonfur.ca/nowhere/score.ini.txt

-- 
The Tech Zero, Maxx Pollare - Back into the Keys of Xnews...
Re: [Xnews] HELP - Selectivly allowing cross-posts?
#149402
Author: »Q«
Date: Sat, 05 Jun 2004 12:56
54 lines
3182 bytes
Tech Zero <spamnet-june@dragonfur.ca> wrote in
<news:Xns94FF2A78E722FZeroOne@raven.dragonfur.ca>:

> So I did what I've done before, and spent the last few days (read:
> sleepless nights) beefing up my Score.ini,

You are one tenacious dragon!

> which lead me to my  question:  Is there a way to selective allow
> cross-posts to only certain groups in a single line entry?
>
> One of the entries I'm using:
>   [^alt\.fan\.dragons$]
>   Score: -2700
>      Xref: (.*:){2}
>      ~Xref: furry|magick|mythology
>
> I'd like to drop it to a single "Xref" test, so I can test other
> entries if first condition is false, but I haven't had any luck
> yet.

If I'm reading you correctly (just started first cup of coffee), I
think this will do what you want:

Xref: (?!.*?(furry|magick|mythology))(.*?:){2}

That's a relatively expensive regex;  it may require looking through
the entire field up to four times.  Maybe limit it to the one
server which carries the problem posts.

Xref: ^news\.server\.address\s(?!.*?(furry|magick|mythology))(.*?:){2}

> I suspect it has something to do with PCRE "Look ahead/behind
> assertion", but I've just started use those Regex entries, and the
> first few tests (read: dozen of so) didn't work as expected.

As you can see above, I think a negative lookahead is the way to go.
Since we don't know where in the string (furry|magick|mythology) may
occur, I used (?!.*? at the beginning, to look through the entire
string.

Lookbehinds are a PiTA, at least for me, because of the limitation
of looking for a string of fixed length.  I find I never need
positive lookaheads/behinds for Xnews scoring, only negative ones.
I don't use them much, and can't think of any further possibly
useful comments to make.

> The rest of the new entries are online, and any suggestions are
> welcome:  http://www.dragonfur.ca/nowhere/score.ini.txt

Thanks again for maintaining that online for everyone's benefit.

-- 
»Q«
Re: [Xnews] HELP - Selectivly allowing cross-posts?
#149414
Author: Tech Zero
Date: Sat, 05 Jun 2004 20:15
61 lines
3733 bytes
The voice of ""Q"" drifted in on the cyber-winds, 
from the sea of virtual chaos...

>> So I did what I've done before, and spent the last few days
>> (read: sleepless nights) beefing up my Score.ini,
> 
> You are one tenacious dragon!

Well... I'm actually between dragons... But that's another story.
 
>> which lead me to my  question:  Is there a way to selective allow
>> cross-posts to only certain groups in a single line entry?
 <snip>
> If I'm reading you correctly (just started first cup of coffee), I
> think this will do what you want:
> 
> Xref: (?!.*?(furry|magick|mythology))(.*?:){2}

Yep, this works...
But on retrospect there are only three posts that it affects, all from 
last year, so I could get away with just "(.*:){2}".  That doesn't make 
the question any less valid, just academic.

> That's a relatively expensive Regex; it may require looking
> through the entire field up to four times.  Maybe limit it to the
> one server which carries the problem posts.

Since I'm pulling from my own sever, I can't limit it...
At lest not from within Xnews at in any case (evil thoughts brewing).

But there's no shortage of processing power here, and since the 
server's "local" (sitting next to Voxie here) there's not real penalty 
for filtering on any header.  Plus I get the added benefit of being 
able to read my subscribed groups "even" when the shpxvat cable 
connection is down (like right now).

I may sit down and create a few SPAM filters for Dnews, to kill em
at the server.  But that's an exorcise for another day.

>> I suspect it has something to do with PCRE "Look ahead/behind
>> assertion", but I've just started use those Regex entries, and
>> the first few tests (read: dozen of so) didn't work as expected.
> 
> As you can see above, I think a negative lookahead is the way to
> go. Since we don't know where in the string
> (furry|magick|mythology) may occur, I used (?!.*? at the
> beginning, to look through the entire string.
> 
> Lookbehinds are a PiTA, at least for me, because of the limitation
> of looking for a string of fixed length.  I find I never need
> positive lookaheads/behinds for Xnews scoring, only negative ones.
> I don't use them much, and can't think of any further possibly
> useful comments to make.

I don't know...
There are allot of times when you need to reverse an entry to get 
things to work, so it's nice to have positive assertion available.
But I can't think of a reason why I'd need it right now.

-- 
The Tech Zero, Maxx Pollare - Back into the Keys of Xnews...
Re: [Xnews] HELP - Selectivly allowing cross-posts?
#149418
Author: »Q«
Date: Sat, 05 Jun 2004 21:10
18 lines
1941 bytes
Tech Zero <spamnet-june@dragonfur.ca> wrote in
<news:Xns94FF9108073F7ZeroOne@raven.dragonfur.ca>:

> There are allot of times when you need to reverse an entry to get
> things to work, so it's nice to have positive assertion available.
> But I can't think of a reason why I'd need it right now.

I've thought of one that might come in handy someday.  Positive
lookaheads can be used to make Boolean AND expressions.  To match
strings containing 111 and 222 and 333 and 444, in any order,

(?=.*?111)(?=.*?222)(?=.*?333).*?444

It's shorter and easier to edit than the other option, which is to
use OR pipes with all the permutations of the ANDed substrings.

-- 
»Q«
Re: [Xnews] HELP - Selectivly allowing cross-posts?
#149453
Author: Tech Zero
Date: Sun, 06 Jun 2004 11:09
19 lines
1811 bytes
The voice of "»Q«" drifted in on the cyber-winds, 
from the sea of virtual chaos...

> I've thought of one that might come in handy someday.  Positive
> lookaheads can be used to make Boolean AND expressions.  To match
> strings containing 111 and 222 and 333 and 444, in any order,
> 
> (?=.*?111)(?=.*?222)(?=.*?333).*?444
> 
> It's shorter and easier to edit than the other option, which is to
> use OR pipes with all the permutations of the ANDed substrings.


Well "that" plays it...  This thread is a keeper.

Check out the latest update.  };8)

-- 
The Tech Zero, Maxx Pollare - Back into the Keys of Xnews...
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