Article View: news.software.readers
Article #205241Re: Update: [slrn] NNTP-Posting-Host whois lookup macro
From: Peter J Ross
Date: Wed, 05 Sep 2007 16:09
Date: Wed, 05 Sep 2007 16:09
47 lines
2741 bytes
2741 bytes
In news.software.readers on Wed, 05 Sep 2007 15:12:45 +1000, Troy
Piggins <usenet-0709@piggo.com> wrote:
#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-
Very nice.
To be bulletproof on all the OSes slrn can run on, you probably need
to check for the existence of a program named "whois" (not AFAIK
available by default on Windows, at least up to Win2k, or on a minimal
Debian installation). The same applies to "less", with the added
complexity that some people may use "more", "most" or even "vi" as
their pager.
Or just add a comment explaining that
() = system ( "whois "+postinghost+" | less");
may need to be edited.
Have you considered making your useful collection of macros available
as a .deb and/or .rpm? If you did, you could specify suggested
dependencies, such as, in this case, a whois client and a pager.
--
PJR :-)
Technical Details
Message-ID:
<slrnfdtl54.3bm.pjr@pjr.gotdns.org>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!postnews.google.com!news1.google.com!news.glorb.com!news-out.octanews.net!indigo.octanews.net!authen.yellow.readfreenews.net.POSTED!not-for-mailReferences:
<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> <20070905150540@usenet.piggo.com>Show Full Headers
Complete Article Headers
Message-ID: <slrnfdtl54.3bm.pjr@pjr.gotdns.org> Subject: Re: Update: [slrn] NNTP-Posting-Host whois lookup macro Date: Wed, 05 Sep 2007 16:09:08 +0000 From: Peter J Ross <pjr@example.invalid> 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> <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!postnews.google.com!news1.google.com!news.glorb.com!news-out.octanews.net!indigo.octanews.net!authen.yellow.readfreenews.net.POSTED!not-for-mail Newsgroups: news.software.readers Organization: none Reply-To: pjr.spam@gmail.com User-Agent: slrn/0.9.8.1pl2.1 (Linux) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 47 NNTP-Posting-Date: 05 Sep 2007 11:09:08 CDT X-Trace: DXC=UeOdP^fOSn7?@YhM`CKcW<]AGWjF5PjP9465Ue@WB_5?=iD6ZLH2gX626Z<EbT:a\5lV3mi\haFg8[\J[m5T^075`o6Ed?THQk?