Re: ietf-nntp FAQ Extension to NNTP

Dave Barr <barr@math.psu.edu> Thu, 22 August 1996 13:51 UTC

Received: from ietf.org by ietf.org id aa00993; 22 Aug 96 9:51 EDT
Received: from cnri by ietf.org id aa00989; 22 Aug 96 9:51 EDT
Received: from PHEASANT.ACADEM.COM by CNRI.Reston.VA.US id aa07525; 22 Aug 96 9:51 EDT
Received: (from majordom@localhost) by pheasant.ACADEM.COM (8.7.5/8.7.3) id IAA18072 for ietf-nntp-outgoing; Thu, 22 Aug 1996 08:52:03 -0500
X-Authentication-Warning: pheasant.ACADEM.COM: majordom set sender to owner-ietf-nntp using -f
Received: from academ.com (root@ACADEM.COM [198.137.249.2]) by pheasant.ACADEM.COM (8.7.5/8.7.3) with ESMTP id IAA18068 for <ietf-nntp@PHEASANT.ACADEM.COM>; Thu, 22 Aug 1996 08:52:01 -0500
Received: from math.psu.edu (root@leibniz.math.psu.edu [146.186.130.2]) by academ.com (8.7.5/8.7.1) with ESMTP id IAA12263 for <ietf-nntp@academ.com>; Thu, 22 Aug 1996 08:47:17 -0500 (CDT)
Received: from augusta.math.psu.edu (barr@augusta.math.psu.edu [146.186.132.2]) by math.psu.edu (8.7.5/8.7.3) with ESMTP id JAA06953; Thu, 22 Aug 1996 09:47:14 -0400 (EDT)
Received: from localhost (barr@localhost) by augusta.math.psu.edu (8.7.5/8.7.3) with ESMTP id JAA22781; Thu, 22 Aug 1996 09:47:11 -0400 (EDT)
Message-Id: <199608221347.JAA22781@augusta.math.psu.edu>
To: Pat Brans <pbrans@cscsm.de>
cc: ietf-nntp@academ.com
Subject: Re: ietf-nntp FAQ Extension to NNTP
In-reply-to: Your message of "Thu, 22 Aug 1996 15:02:50 +0200." <9608221502.aa08060@clapton.cscsm.de>
References: <9608221502.aa08060@clapton.cscsm.de>
X-Face: $+9-wYg.[->94HJ{go[7Q]E!K&hUg7ZhLyCMyq_FU*ca0GazE>^/2BKLcK0bP-'%; Nn?M<m c~dP_j^A?M5Jw{+a7vcMu|M-mq"V4AzKq?mPMMNP\; f8J0n\-L]ODU)YMP; -pF>+am,jlSP>1K$iz@ %'v'FEW{@](U&Ed/}>ju3Ctlr!XwJ27Q)7h2a%"`sz; j:/3EC[mXi@*X@HE1]'ddq$ZX"ePsMyTkeg >zdML.SV<t=R>vX1W`adGIUD
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Date: Thu, 22 Aug 1996 09:47:10 -0400
Sender: ietf-archive-request@ietf.org
From: Dave Barr <barr@math.psu.edu>
X-Orig-Sender: owner-ietf-nntp@academ.com
Precedence: bulk

This whole protocol is rather unnecessary.

There's already a proposed standard for identifying FAQs -- it's just
a matter of getting newsreaders to use it.

son-of-rfc1036 has the "Article-Names:" header, to identify not only
FAQs but other sorts of periodic postings.  One simply has to do
an "Xhdr Article-Names" and then concatenate that list with articles
crossposted to *.answers.  Here's proof-of-concept Perl code:

#!/usr/local/bin/perl
#
# listfaq      List and get FAQ's for a group
#
# Author: David Barr <barr@pop.psu.edu>
# Much code stolen from repost_faq by Bill Fenner <fenner@cmf.nrl.navy.mil>il>,
# which I think he stole some from post_faq by jik.
#
# rewritten to use Net::NNTPClient.pm
#
# $Id: listfaq,v 1.1 1994/05/13 22:06:26 barr Exp barr $
#    -v   verbose.  More wordy
#
use News::NNTPClient;
require 'getopts.pl';

### Fiddle with these.
@faq_groups=("news.answers", "psu.answers");
$DEFAULT_NNTP_SERVER="news.math.psu.edu";	# Who do we usually talk to?

# Be sure you have "Xref:full" in overview.fmt on server.
#
# Comment this out if you don't have "Article-Names:Xref" in overview.fmt
# or if you don't mind it if the server takes a real long time to do
# an XHDR Article-Names
# This header is defined in son-of-rfc1036
# $check_article_name=1;

### stop fiddling

do Getopts(':v');
$verbose=$opt_v;
&usage if (($group=$ARGV[0]) eq '');

$nntpserver=$ENV{'NNTPSERVER'} || $DEFAULT_NNTP_SERVER;
$ORGANIZATION=$ENV{'ORGANIZATION'} || $DEFAULT_ORGANIZATION;

$open=0;
print "Connecting to $nntpserver...\n" if ($verbose);
$c=new News::NNTPClient($nntpserver);
#$c->debug(2);
print "Selecting $group....\n" if ($verbose);
($first,$last)=$c->group($group);
die "Can't search $group: $last\n" if ($first < 1);
@ng=($group);
$everything=(&ngcheck);   # assume all are faqs if we search a faq group
print "Scanning $group.\n" if ($verbose);
@header=$c->xhdr("Xref",$first,$last);
foreach $line (@header) {
	($artno,$server,$rest)=split(/ /,$line,3);
	@ng=split(/ /,$rest);
	if (($everything) || (&ngcheck)) {
		$arts{$artno}=1;
	}
}
$_[2]=$last;

if ($check_article_name==1) {
	@header=$c->xhdr("Article-Names",$first,$last);
	print "Scanning $group.\n" if ($verbose);
	foreach $line (@header) {
		($artno,$server,$rest)=split(/ /,$lne[1],3);
		@ng=split(/ /,$rest);
		if (($everything) || (&ngcheck)) {
			$arts{$artno}=1;
		}
	}
}

@artlist=sort increasing (keys arts);

print "retrieving articles..\n" if ($verbose);

foreach $art (@artlist) {
	@tmphead=$c->xhdr("Subject",$art);
	($rest,$s)=split(/ /,$tmphead[0],2);
	write;
}


format top =
art no   Subject
-------- ----------------------------------------------------------------------