Thread View: news.software.readers
1 messages
1 total messages
Started by Bob Munck - Unisys
Mon, 26 Aug 1991 15:38
Using slocal to scan USENET newsgroups
Author: Bob Munck - Unisys
Date: Mon, 26 Aug 1991 15:38
Date: Mon, 26 Aug 1991 15:38
80 lines
4088 bytes
4088 bytes
CAN'T KEEP UP WITH EVEN YOUR FAVORITE NEWSGROUPS?
Here's a quick-and-dirty shell procedure to scan various newsgroups
for subjects, keywords, authors, etc. of interest to you and put
any messages found into MH folders:
=====CUT=HERE=====CUT=HERE=====CUT=HERE=====CUT=HERE=====CUT=HERE=====
#! /bin/csh -f
########################################################
# ~/.newsdelivery is a hidden directory containing maildelivery files
#
# The name of a maildelivery file is the newsgroup it applies to.
# I.e. sci.electronics, comp.lang.ada
#
# The first line of each maildelivery file is a comment containing the
# highest filename (number) previously read from that newsgroup
# When creating the maildelivery file, use "# 0" for the first line and
# "default - destroy A -" for the last.
#
# The rest of the maildelivery file is in the same form as .maildelivery.
# Here is my initial file ~/.newsdelivery/sci.space
#
# # 0
# Subject "toward 2001" | ? "rcvstore +unread-low -create"
# Subject "spacenews" | ? "rcvstore +unread-low -create"
# Subject "nasa headline news for" | ? "rcvstore +unread-low -create"
# Subject "aw&st" | ? "rcvstore +unread-low -create"
# Subject "spacelab" | ? "rcvstore +unread-low -create"
# Summary "spacelab" | ? "rcvstore +unread-low -create"
# Keywords "spacelab" | ? "rcvstore +unread-low -create"
# default - destroy A -
#
# This adds to my low-priority unread message folder several news summary
# messages that appear in sci.space and any message with SpaceLab mentioned
# in the subject, summary, or keywords line. The last line prevents the
# adding of all other messages to my mailbox; don't omit it.
#
# Unfortunately, the pattern is not a regular expression, but only an
# unanchored, case-insensitive string match.
#
#########################################################
cd ~/.newsdelivery
foreach d ( * )
set hi = `head -1 $d | sed 's/^..//'` # get high-water mark
cd /var/spool/news/`echo $d | sed 's/\./\//g'` # goto newsgroup dir(*)
foreach f ( [0-9]* )
if ( $hi < $f ) then
set hi = $f
slocal -maildelivery ~/.newsdelivery/$d <$f # consider the message
endif
end
cd ~/.newsdelivery
echo "1s/^.*/# $hi/\ # update hi-water
w\
q" | ed $d >/dev/null
end
=====CUT=HERE=====CUT=HERE=====CUT=HERE=====CUT=HERE=====CUT=HERE=====
(*) may need to be changed for local file structure.
As I said, quick and dirty. The use of slocal scanning greatly limits how
clever the scan can be, probably giving you matches that you would prefer
not be made. I've also written procs to create maildelivery files in
.newsdelivery and add lines to them. The above procedure is added to my
run-early-every-morning batch job.
If only slocal supported full egrep pattern matching!
--
Bob Munck, Deputy Architect, Unisys STARS
EMAIL: Munck@STARS.Reston.Unisys.COM
USPS: STARS - 7670
Unisys Corporation
12010 Sunrise Valley Drive
Reston, VA 22091
PHONE: 703/620-7991
PHAX: 703/620-7916
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads