🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #135021

Re: Hamster and or Korrnews

#135021
From: Antonio 'Gandalf' Favata
Date: Mon, 06 Oct 2003 14:36
83 lines
4942 bytes
news.software.readers ~ 6/10/2003 16.24 ~ Henrik K Hansen:

> I'm very impressed, but hs2 is obsolete, shouldent it be.
>>|| #!load hamster.hsm

The hamster.hsm is not needed, so I don't load it :)
And about #!hs2:
|| #!hs2
|| 
|| This command is ignored and might be removed in a future script-version, but if a Hamster-Script is executed by Hamster, it has to be the first line of each script, with no leading spaces before it. It is the marker which invokes the new script-engine and not the old (unsupported) one.


>>||             varset($siglines, $lastline - ListIndexOf($Body, "-- "))
> and what about the OE sig delimiter.

Damned OE! :P
ListIndexOf doesn't support regex, so I could make a check...
And, shame on me, if there's _no_ delimiter, the script goes kinda crazy!
So I'll add another check. Here it is the new version:

|| #!hs2
|| 
||     varset($Message, ArtAlloc)
||     ArtLoad($Message, paramstr(2))
|| 
||         varset($Body, ListAlloc)
||         ListSetText($Body, trim(ArtGetBody($Message)))
|| 
||             varset($lastline, ListCount($Body) - 1)
||             varset($index, ListIndexOf($Body, "-- "))
||             if ($index = -1)
||                 $index = ListIndexOf($Body, "--")
||             endif
||             
||             if ($index != -1)
||                 varset($siglines, $lastline - $index)
||                 if ($siglines > 4)
||                     ArtSetHeader($Message, "X-Removed-Signature", "Yes, "+$siglines+" lines")
||                     var($i)
||                     for ($i, 0, $siglines)
||                         ListDelete($Body, $lastline - $i)
||                     endfor
||                     ArtSetBody($Message, ListGetText($Body))
||                 endif
||             endif
|| 
||         ListFree($Body)
|| 
||     ArtSave($Message, paramstr(2))
||     ArtFree($Message)
|| 
|| quit

> Subject: [despammed] Re: a subject
> and the end of the body
[...]
> I don't think that possible to do with the Hamster.

It is indeed, I wrote this script months ago ;)
Some extracts:
|| ArtDelHeader($Message, "X-Despammed-Tracer")

||     varset($Subject, ArtGetHeader($Message, "Subject"))
||     if RE_Match($Subject, "^\[despammed\] ")
||         ArtSetHeader($Message, "Subject", Replace($Subject, "[despammed] ", ""))
||     endif

||     varset($Sponsor, "^(Filtered by despammed\.com\.  Tracer: \w{3}\d{15}|
||     Remember: you can forward any spam that slips through the filters|
||     to the abuse desk here at Despammed\.)$")
#	on the same line of course...

||     varset($s, ListCount($Body)-1)
||     while RE_Match(ListGet($Body, $s), $Sponsor)
||         ListDelete($Body, $s)
||         dec($s)
||     endwhile
-- 
Fare Well! | gandalf@ithn.net ~ ICQ# 16553733 ~ now: 06/10/2003 16.25.52
G          | Advice:     40tude Dialog 2.0.5.1 <http://snurl.com/dialog>

I will not Xerox my butt (Bart's chalkboard #7F01)
Technical Details
Message-ID: <7v8y893zu3kl$.dlg@gandalf.my-fqdn.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.stueberl.de!fu-berlin.de!uni-berlin.de!212.141.245.50!not-for-mail
References: <n00teym8f80d$.dlg@marcmywords.com> <3escqpk8har0$.dlg@gandalf.my-fqdn.de> <oqxyk73wts0c.dlg@marcmywords.com> <1nohhgb44nej3$.dlg@gandalf.my-fqdn.de> <1vgzz7yap7n6p.dlg@marcmywords.com> <7wgrizeg7o2o$.dlg@gandalf.my-fqdn.de> <1j8kgxm1d2gu8$.dlg@marcmywords.com> <136x13sb7456v.dlg@ID-187316.user.uni-berlin.de> <1s8ilubabsgox$.dlg@marcmywords.com> <06.10.2003.14.50.52$news.software.readers$@hkh.dyndns.dk> <fx4hw1inozlc.dlg@gandalf.my-fqdn.de> <06.10.2003.15.06.35$news.software.readers$@hkh.dyndns.dk> <e7zj9hyoqxvh$.dlg@gandalf.my-fqdn.de> <06.10.2003.15.37.12$news.software.readers$@hkh.dyndns.dk> <1kekrnn292zxv$.dlg@gandalf.my-fqdn.de> <06.10.2003.16.24.42$news.software.readers$@hkh.dyndns.dk>

Show Full Headers
Complete Article Headers
Message-ID: <7v8y893zu3kl$.dlg@gandalf.my-fqdn.de>
Subject: Re: Hamster and or Korrnews
Date: Mon, 06 Oct 2003 14:36:45 +0000
From: Antonio 'Gandalf' Favata <this.address.is.valid@bigfoot.com>
References: <n00teym8f80d$.dlg@marcmywords.com> <3escqpk8har0$.dlg@gandalf.my-fqdn.de> <oqxyk73wts0c.dlg@marcmywords.com> <1nohhgb44nej3$.dlg@gandalf.my-fqdn.de> <1vgzz7yap7n6p.dlg@marcmywords.com> <7wgrizeg7o2o$.dlg@gandalf.my-fqdn.de> <1j8kgxm1d2gu8$.dlg@marcmywords.com> <136x13sb7456v.dlg@ID-187316.user.uni-berlin.de> <1s8ilubabsgox$.dlg@marcmywords.com> <06.10.2003.14.50.52$news.software.readers$@hkh.dyndns.dk> <fx4hw1inozlc.dlg@gandalf.my-fqdn.de> <06.10.2003.15.06.35$news.software.readers$@hkh.dyndns.dk> <e7zj9hyoqxvh$.dlg@gandalf.my-fqdn.de> <06.10.2003.15.37.12$news.software.readers$@hkh.dyndns.dk> <1kekrnn292zxv$.dlg@gandalf.my-fqdn.de> <06.10.2003.16.24.42$news.software.readers$@hkh.dyndns.dk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.stueberl.de!fu-berlin.de!uni-berlin.de!212.141.245.50!not-for-mail
Newsgroups: news.software.readers
Organization: the White Council
Lines: 82
Reply-To: gandalf@ithn.net
NNTP-Posting-Host: 212.141.245.50
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de 1065451005 15963275 212.141.245.50 (16 [197363])
X-Now-Playing: Elisa - Heaven out of hell
User-Agent: 40tude_Dialog/2.0.5.166it (2c64a008.347.182) Hamster/2.0.2.2
X-Face: &]^_njQjKuBI.th%)W1+ESkFY4E:r*#8}rkHLF'QTLo,>mql9aGkV*,v.-,qVdu&8Xk(6K
X-Pets: Merry <http://snurl.com/merry>, Mystra [female hamster], John Mayall [pelouche pig], Alice [my love ;*]