🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #205228

Update: [slrn] NNTP-Posting-Host whois lookup macro

#205228
From: Troy Piggins
Date: Wed, 05 Sep 2007 05:12
94 lines
4200 bytes
* Blinky the Shark is quoted & my replies are inline below :
> Troy Piggins wrote:
>> * Blinky the Shark is quoted & my replies are inline below :
>>> Blinky the Shark wrote:
>>> [---=| Quote block shrinked by t-prot: 33 lines snipped |=---]
>>>>> #v-
>>>>
>>>> I ran it on your post and got:
>>>>
>>>><q>
>>>>
>>>> Unknown AS number or IP network. Please upgrade this program.
>>>> lines 1-1/1 (END) 
>>>>
>>>></q>
>>>
>>> Then I ran it on some of my own posts and got the slrn help page(s).
>>
>> You sure it's /slrn/ help pages?  I got the 'whois --help'
>> output.
>
> DUH!  Yeah, it's from whois.  Don't look a damn bit like slrn help.
>
> [embarrassed]

:)

Try this one[1] on for size.  It now checks if the header even
exists first so it throws an error message before whois can
chuck-a-wobbly and give its help error message.

>> That would be because your posts don't seem to contain the
>> NNTP-Posting-Host header.  I should add a check for that.  I
>> should have done that first time round.
>
> Ah!  I think we just had a discussion on that, and some of the regs here
> have them and some don't.  I didn't think of that either.

Yeah, you guys using mixmaster, anonymous remailers, etc trying
to hide your privacy ;)  Hackers, all of ya!

Just kidding - it's a server thing.  Some force it.  Some don't.
I know motzarella doesn't have it, but my ISP does.  You can't
win 'em all.

If anyone knows of other headers that may contain useful
IP/hostname information, let me know and I can add it.

>>> Then I ran it on some other people's posts and got the whois.
>>
>> Ok - so it works when the header exists in most cases.
>>
>> Thanks for the feedback.  Do you think it's worthwhile?
>
> Not every day, probably, but it's small and fast and it provides
> information.  That can't be bad.
>
> Annc when you add the header check...

Done.

[1] Watch the wrapping, some of the lines below are longer than
80 chars:

#v+
define whois_postinghost () {

  variable status= is_article_visible ();

  if ( status & 1) {
    variable postinghost= extract_article_header ( "NNTP-Posting-Host");
  
    variable ph_exists= strlen ( postinghost);
  
    if ( ph_exists > 0) {
      () = system ( "whois "+postinghost+" | less");
    } else {
     throw InvalidParmError, "This article doesn't contain a NNTP-Posting-Host header"; 
    }

  } else {
    throw InvalidParmError, "You need to display the article to check";
  }

}

definekey ( "whois_postinghost", "\eH", "article");
#v-

-- 
Troy Piggins | http://piggo.com/~troy                             
                                            ___  |   __   __    ,-O   (o-    O 
slrn macros and howto:                     |___  | |/   |/  |  O   )  //\     O
http://piggo.com/~troy/slrn                 ___| | |    |   |   `-O   V_/_  OOO
Technical Details
Message-ID: <20070905150540@usenet.piggo.com>
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!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.iinet.net.au!newsfeed.iinet.net.au!per-qv1-newsstorage1.iinet.net.au!per-qv1-newsstorage1.iinet.net.au!per-qv1-newsreader-01.iinet.net.au!not-for-mail
References: <20070905110242@usenet.piggo.com> <slrnfds2dc.vb2.no.spam@thurston.blinkynet.net> <slrnfds2sp.vb2.no.spam@thurston.blinkynet.net> <20070905120737@usenet.piggo.com> <slrnfds750.178.no.spam@thurston.blinkynet.net>

Show Full Headers
Complete Article Headers
Message-ID: <20070905150540@usenet.piggo.com>
Subject: Update: [slrn] NNTP-Posting-Host whois lookup macro
Date: Wed, 05 Sep 2007 15:12:45 +1000
From: Troy Piggins <usenet-0709@piggo.com>
References: <20070905110242@usenet.piggo.com> <slrnfds2dc.vb2.no.spam@thurston.blinkynet.net> <slrnfds2sp.vb2.no.spam@thurston.blinkynet.net> <20070905120737@usenet.piggo.com> <slrnfds750.178.no.spam@thurston.blinkynet.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!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.iinet.net.au!newsfeed.iinet.net.au!per-qv1-newsstorage1.iinet.net.au!per-qv1-newsstorage1.iinet.net.au!per-qv1-newsreader-01.iinet.net.au!not-for-mail
Newsgroups: news.software.readers
Reply-To: usenet-0709@piggo.com
X-NNTP-Proxy: Leafnode-2
 (http://www-dt.e-technik.uni-dortmund.de/~ma/leafnode/beta/)
User-Agent: slrn/0.9.8.1pl2.1/rt (Linux)
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 94
NNTP-Posting-Host: 124.171.229.82
X-Trace: 1188969171 per-qv1-newsreader-01.iinet.net.au 28542 124.171.229.82