[net.news.group] Table of contents for news

moriarty@fluke.UUCP (Jeff Meyer) (11/07/84)

>Only one other person mentioned this in the 200+ articles I read in the last
>few days (sorry, I forgot who) -- is there anyway to get the news reading
>software (readnews, vnews, etc.) to display a "Table of Contents" based on
>the Subject Line or Keywords Line of, for example, a screenful of articles.
>At that point, the user would be able to decide which articles they do not
>want to read.  Then the software would take that info and update the .newsrc
>file to reflect the wishes of the user.

I believe there is already a package that does this in the emacs editor.
Very nice, but it takes a little while to run (understatement,
understatement...), and takes up quite a bit of disk space.  Still, if you
use emacs, you might like to try that.

			"This friendly reminder is also offered in Braille..."

					Moriarty, aka Jeff Meyer
					John Fluke Mfg. Co., Inc.
UUCP:
 {cornell,decvax,ihnp4,sdcsvax,tektronix,utcsrgv}!uw-beaver \
    {allegra,gatech!sb1,hplabs!lbl-csam,decwrl!sun,ssc-vax} -- !fluke!moriarty
ARPA:
	fluke!moriarty@uw-beaver.ARPA

ken@turtlevax.UUCP (Ken Turkowski) (11/12/84)

>Only one other person mentioned this in the 200+ articles I read in the last
>few days (sorry, I forgot who) -- is there anyway to get the news reading
>software (readnews, vnews, etc.) to display a "Table of Contents" based on
>the Subject Line or Keywords Line of, for example, a screenful of articles.
>At that point, the user would be able to decide which articles they do not
>want to read.  Then the software would take that info and update the .newsrc
>file to reflect the wishes of the user.

I have a package, called newsweed, which does more than that.
"readnews -l" will create a table of contents, but newsweed puts this
into a file, then puts you into your favorite editor to delete titles
of articles that you do not wish to read.  Newsweed then edits your
.newsrc file with awk to reflect the changes.  Your may then read the
news at your leisure.

There are some undesirable side effects, though.  Newsweed does take a
long time to both generate the list of titles and to update your
.newsrc, but through the magic of the csh and (^Z, fg, bg) job control
capability, this isn't too bothersome.

Your "options" line should not be continued on other lines.

Also, if you have a feeble Bourne shell that doesn't like long command
lines, you may have to put the awk program into a file, and use the -f
option of awk.

Small computers may suffer, too; the awk script may have to be
rewritten to not be such a memory hog.

I'll repost it in the near future with sufficient interest.
-- 
Ken Turkowski @ CADLINC, Palo Alto, CA
UUCP: {amd,decwrl,flairvax,nsc}!turtlevax!ken
ARPA: turtlevax!ken@DECWRL.ARPA

sunny@sun.uucp (Sunny Kirsten) (11/13/84)

>is there anyway to get [...] a "Table of Contents" for news?<

: This is a shar archive.  Extract with sh, not csh.
: The rest of this file will extract:
: ns
echo extracting - ns
sed 's/^X//' > ns << '/*EOF'
X#! /bin/sh
X#	ns [-a] newsgroups ...
X#	List subject headings of articles in listed newsgroups
X#	starting at last-read article in .newsrc.
X#	With the -a flag all articles are listed.
X#	Author : Oscar Nierstrasz @ utcsrgv!oscar
Xcase $# in
X0 )	echo 'Usage: ns [-a] <news group> ...' 1>&2
X	exit ;;
Xesac
Xnrc=$HOME/.newsrc
Xif test ! -r $nrc
Xthen
X	echo "ns : Can't find $nrc" 1>&2
X	exit
Xfi
Xn=/usr/spool/news
Xs='/^Subject:/ { print FILENAME ": " $0 ; exit }'
Xcase $1 in
X-a )	all=y
X	shift ;;
X* )	all=n ;;
Xesac
Xfor i
Xdo
X	d=`echo $i | sed "s/\./\//g"`
X	if test ! -d $n/$d
X	then
X		echo "$i : no such newsgroup" 1>&2
X	else
X		cd $n/$d
X		echo
X		echo "--- $i : $n/$d ----"
X		echo
X		case $all in
X		y )	f=all ;;
X		n )	f=`sed -n "/^$i:/s/.*-//p" $nrc`
X			case $f in
X			"" )	f=all ;;
X			* )	if test ! -r $f
X				then
X					f=all
X				fi ;;
X			esac ;;
X		esac
X		case $f in
X		all )	for j in *
X			do
X				awk "$s" $j
X			done ;;
X		* )	while test -r $f
X			do
X				awk "$s" $f
X				f=`expr $f + 1`
X			done ;;
X		esac
X	fi
Xdone
/*EOF
exit
-- 
mail ucbvax\!sun\!sunny decvax\!sun\!sunny ihnp4\!sun\!sunny<<EOF

EOF

sunny@sun.uucp (Sunny Kirsten) (11/13/84)

> "readnews -l" will create a table of contents, but NEWSWEED puts this
> into a file, then puts you into your favorite editor to delete titles
> of articles that you do not wish to read.  Newsweed then edits your
> .newsrc file with awk to reflect the changes.  Your may then read the
> news at your leisure.

I have a version of this which started out as the last posting of NEWSWEED,
but which has had the top level shell script changed from sh to csh, and
which supports archiving of news on a machine different than the machine you
read news on, and supports the separation of news into archival save files,
versus news which you only intend to print, not keep.  There are new scripts
which support the transfer and integration of newly read/saved news articles
into your news archive directory on the archival machine, and the automatic
printing of news from the news print directories, without overloading your
print que with such drivel (i.e. it meters the news into the print que).
This counts on Berkeley-ish "rcp" command and "rsh" commands.

I'll post it with sufficient interest.  I'm immediately sending a copy to Ken
in case he want's to steal ideas before his next posting of newsweed.
-- 
mail ucbvax\!sun\!sunny decvax\!sun\!sunny ihnp4\!sun\!sunny<<EOF

EOF

mark@cbosgd.UUCP (Mark Horton) (11/14/84)

A lot of people have posted some fancy replies to this, telling of packages
that jump through hoops, but I haven't seen any of the simple answers posted.

The command
	readnews -l
will print a list of unread news articles on standard out, without updating
your .newsrc.  (This is a poor man's table of contents.)

If you use vnews, type
	a
and it will show the table of contents for the current newsgroup.

If you use rn, type
	=
and it will show the table of contents for the remainder of the
current newsgroup.

	Mark