Article View: news.software.readers
Article #229058Killing β attribution Lines β ( ALs ) is tricky.
From: Jeffβ²Relf
Date: Mon, 19 Jan 2009 08:31
Date: Mon, 19 Jan 2009 08:31
75 lines
3894 bytes
3894 bytes
I've been a regular poster to Usenet since 1991,
I'm not sure if I ever quoted lines using the β > β character.
My posts remain unblocked everywhere, all the time.
Killing all >quoted lines is easy, and
the β β. β prefix in front of the original content
tells me that >quoted lines were killed. I love it ! ( so far )
Killing β attribution Lines β ( ALs ) is tricky.
If there are blank lines at the start of a post, they are removed.
The span of lines ( up to 5 lines ) from there to the next blank line,
or to >quoted line, may or may not be ALs.
If the span of lines ends in a >quoted line,
then X.EXE considers them ALs and remove them ( by not printing them ).
But, if they end in a blank line, then they are ALs
if-and-only-if they contain something like β Left@Right. β
and the begining of the line doesn't look like a link
( e.g. β news:Left@Right.COM β ).
The code ( from JeffRelf.F-M.FM/X.CPP ) looks like this:
// BB points to the body, an array of lines.
// P and B will point to the line ( a null terminated string )
PP = BB - 1 ; int SawQ = 0, Smelly = 0 ; const int MaxAttribLns = 5 ;
while ( ++ PP < EE && PP - BB <= MaxAttribLns && ( P = B = * PP ) ) {
WhileWhite;
// Ch is either null or the first black space in the line.
if ( οΌQuoted || Smelly && ! Ch ) {
// Make the body of the post start after the ALs.
BB = PP + 1, SawQ = 1 ; break ; }
if ( ! Ch )
// β ! Ch β is true so the line is blank, we're done.
// We found no ALs.
break ;
if ( Smelly || EqiN( L"news:", P, 5 ) || EqiN( L"Google.COM", P, 10 )
|| EqiN( L"www.", P, 4 ) || EqiN( L"http:", P, 5 ) )
// This line starts like it's a link, so ignore it.
continue ;
P = FromStart( P, '@' );
if ( ! P || P == B || ! Iden( P[ -1 ] ) || ! Iden( P[ 1 ] ) )
// No β Left@Right β, ignore the line.
continue ;
// β ill β has the β . β char and
// the list of invalid characters for a Right-ID
static LnP ill = L"@.,:;\"()<>[]\\"; P ++ ;
While( Ch > 32 && Ch < 127 ) {
// We're here while Right-ID has U.S. ASCII black space
LnP Svd = P ; int C = Ch ; P = ill ; While( C != Ch );
if ( Ch == '.' )
// Found the β Left@Right. β, we're in β Smelly β ALs.
Smelly = 1 ;
int Done = Ch ; P = Svd, Ch = 1 ; if ( Done ) break ; } }
.......
inline int Iden( wchar_t C ) {
return C == '_' || C >= 128 || Alpha_Numeric ( C ); }
#define οΌQuoted ( Ch == '>' || Ch == '|' )
#define EqiN ! wcsnicmp
#define While( Should_Loop ) Ch = 1 , P -- ; \
while ( Ch && ( Ch = * ++ P, Ch2 = ! Ch ? 0 : P[ 1 ], Should_Loop ) )
#define WhileWhite While ( Ch && ( Ch <= 32 || Ch == L'ΒΈ' ) )
Technical Details
Message-ID:
<Jeff_Relf@Seattle.2009_Jan.19|0.31am|i>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.free.newsservers.20150605.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mailReferences:
<80ab9vyazp.fsf@banana.shacknet.nu> <Jeff_Relf@Seattle.2009_Jan.15|3.57am|P> <slrngmuesk.9f.steve@news.mixmin.net> <80k58whdxv.fsf@banana.shacknet.nu> <Jeff_Relf@Seattle.2009_Jan.18|2.34am|t> <slrngn6jsi.gbb.steve@news.mixmin.net>Show Full Headers
Complete Article Headers
Message-ID: <Jeff_Relf@Seattle.2009_Jan.19|0.31am|i> Subject: Killing β attribution Lines β ( ALs ) is tricky. Date: Mon, 19 Jan 2009 08:31:41 +0000 From: Jeffβ²Relf <Jeff_Relf@Seattle.Test> References: <80ab9vyazp.fsf@banana.shacknet.nu> <Jeff_Relf@Seattle.2009_Jan.15|3.57am|P> <slrngmuesk.9f.steve@news.mixmin.net> <80k58whdxv.fsf@banana.shacknet.nu> <Jeff_Relf@Seattle.2009_Jan.18|2.34am|t> <slrngn6jsi.gbb.steve@news.mixmin.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.free.newsservers.20150605.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Newsgroups: alt.free.newsservers,news.software.readers Lines: 75 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net xuB3a0FK3AikY47q8xnxpg0Yo/aeSq7Cl+Ah2CGHvz1hol6d/o Cancel-Lock: sha1:U+GxahZWrLWjOgsDdALDuraAZZY= User-Agent: JeffRelf.F-M.FM/X.ZIP