Thread View: news.software.readers
5 messages
5 total messages
Started by Dan_Jacobson
Mon, 05 Aug 1991 19:02
archeck -- Find your recently posted to newsgroups
Author: Dan_Jacobson
Date: Mon, 05 Aug 1991 19:02
Date: Mon, 05 Aug 1991 19:02
156 lines
6006 bytes
6006 bytes
Wouldn't it be neat to remember where you've been posting recently?
How 'bout a shell script that would do this:
$ archeck 1
Mon Aug 5 13:14:00 CDT 1991
======5th====== newsgroups posted to on the 5th:
gnu.emacs.gnus
rec.arts.tv
rec.music.funky
[...etc. Here's the shell script:]
#! /bin/sh
# This is a shell archive. Remove anything before this line, then feed it
# into a shell via "sh file" or similar. To overwrite existing files,
# type "sh file -c".
# The tool that generated this appeared in the comp.sources.unix newsgroup;
# send mail to comp-sources-unix@uunet.uu.net if you want that tool.
# Contents: archeck
# Wrapped by danj1@ihburn on Mon Aug 5 13:50:53 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
echo If this archive is complete, you will see the following message:
echo ' "shar: End of archive."'
if test -f 'archeck' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'archeck'\"
else
echo shar: Extracting \"'archeck'\" \(3685 characters\)
sed "s/^X//" >'archeck' <<'END_OF_FILE'
X: use /bin/sh
X# Wouldn't it be neat to remember where you've been posting recently?
X# How 'bout a shell script that would do this:
X# $ archeck 2
X# Mon Aug 5 13:14:00 CDT 1991
X#
X# ======5th====== newsgroups posted to on the 5th:
X# gnu.emacs.gnus
X# rec.arts.tv
X# rec.music.funky
X#
X# ======4th====== newsgroups posted to on the 4th:
X# comp.emacs
X# comp.unix.programmer
X# gnu.emacs.help
X# misc.consumers
X# rec.autos.driving
X# rec.food.cooking
X# sci.geo.geology
X# sci.lang
X# sci.space
X#
X# @@@@@@@@@@@@@@@@ Summary @@@@@@@@@@@@@@@@
X# comp.emacs
X# comp.unix.programmer
X# gnu.emacs.gnus
X# gnu.emacs.help
X# misc.consumers
X# rec.arts.tv
X# rec.autos.driving
X# rec.food.cooking
X# rec.music.funky
X# sci.geo.geology
X# sci.lang
X# sci.space
X#
X# (Then you could do)
X# $ archeck 2 | mail your_boss your_professor etc.
X# (just joking. Anyway, here's the (rest of the) shell script:)
X
X#Find your recently posted to newsgroups. Optional $1 is how many
X#days to search backward, default 21. Cannot go back more than a
X#month. Assumes you save your posted articles in a different file
X#every day. I save mine in, e.g., $HOME/.mail/#postedSun4Aug [adjust
X#"$file" below]. Written by Dan_Jacobson@ATT.COM 8/1991, who isn't
X#really planning on doing bug fixes, enhancements, etc. Seems pretty
X#portable.
X
X#set -e
Xlimit=${1-21} #articles expire her 14 days, but some one might have
X#replied to something posted a week earlier... so should check 21 days...
Xset `date`; today=$3
Xecho $@ #date, because I often print it out on paper for later analysis
Xi=0
Xwhile test $i -lt $limit
Xdo
X #no big deal that this month may have less than 31 days
X search_date=`expr \( \( 30 + $today - $i \) % 31 \) + 1` #1..31
X #never negative internally for older expr's
X
X case $search_date in #make correct English suffix
X 1|21|31) suffix=st;;
X 2|22) suffix=nd;;
X 3|231) suffix=rd;;
X *) suffix=th;;
X esac
X echo
X echo ======${search_date}${suffix}====== \
X newsgroups posted to on the ${search_date}${suffix}:
X file=$HOME/.mail/#posted???${search_date}??[a-z] #...you might
X #customize this. [This is within 14 characters filename
X #limits for those systems where it's a problem.]
X test -f $file &&
X todays=`grep '^Newsgroups: ' $file |
X sed 's/.*Newsgroups: //'|
X tr ',' '\012'| #portable between SYS V & BSD
X sort -u`
X echo "$todays"
X all="${all+$all
X}$todays"
X i=`expr $i + 1`
Xdone
Xecho
Xecho @@@@@@@@@@@@@@@@ Summary @@@@@@@@@@@@@@@@
Xecho "$all"|sort -u
X
X#Oh, How would one save their posted articles in a different file
X#every day? well in my .emacs file for GNUS I do:
X
X#(setq
X# news-reply-mode-hook
X# (function
X# (lambda ()
X#
X# (setq
X# gnus-author-copy
X# ;;from gnuspost.el
X# (let ((date (current-time-string)))
X# (if
X# (string-match
X# "^[^ ]+ \\([^ ]+\\)[ ]+\\([0-9]+\\) \\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\) [0-9][0-9]\\([0-9][0-9]\\)"
X# date)
X# (concat ;"/usr/tmp/" (user-login-name)
X# vm-folder-directory "#posted"
X# (substring date 0 3) ;day of week
X# (substring date (match-beginning 2) (match-end 2)) ;Day
X#;;; (substring date (match-beginning 6) (match-end 6)) ;Year
X# (substring date (match-beginning 1) (match-end 1)) ;Month
X#;;; (substring date (match-beginning 3) (match-end 3)) ;Hour
X#;;; (substring date (match-beginning 4) (match-end 4)) ;Minute
X#;;; (substring date (match-beginning 5) (match-end 5)) ;Second
X# )
X# (error "Cannot understand current-time-string: %s." date))
X# )))))
X
X#I suppose you rn users could create an environment variable in your
X#.profile/.login files for exporting a daily save file into rn.
X#After a few weeks I have a cron job clean out the older save files.
END_OF_FILE
if test 3685 -ne `wc -c <'archeck'`; then
echo shar: \"'archeck'\" unpacked with wrong size!
fi
chmod +x 'archeck'
# end of 'archeck'
fi
echo shar: End of archive.
exit 0
Re: archeck -- Find your recently posted to newsgroups
Author: Iain Lea
Date: Tue, 06 Aug 1991 07:40
Date: Tue, 06 Aug 1991 07:40
11 lines
1057 bytes
1057 bytes
This is available in my extensions to the tass newsreader. It lists the date posted, newsgroup and subject line. I will be posting the lot in the next few weeks. Iain -- EMAIL norisc!iain@estevax.UUCP ...!unido!estevax!norisc!iain SNAIL Siemens AG, AUT 922C, Postfach 4848, Nuernberg, Germany PHONE +49-911-895-3853, +49-911-895-3877, +49-911-331963
Re: archeck -- Find your recently posted to newsgroups
Author: Dan_Jacobson
Date: Thu, 08 Aug 1991 16:34
Date: Thu, 08 Aug 1991 16:34
32 lines
1987 bytes
1987 bytes
>>>>> On Thu, 8 Aug 91 01:39:20 EDT, nimbus!hellmond@uunet.UU.NET (Peter H. Hellmonds) said:
P> First: Isn't there a bug in the line where you set the suffix=rd ? :
P> you write: 3|231) suffix=rd;;
P> I think: 3|23) suffix=rd;; would be better.
You are right. Thanks.
P> Second: I use rn, not emacs, but am not familiar enough with it to
P> be able to write my own automatic file-save program.
P> I tried to save the file in a directory .mail with the filename
P> postedThu08Aug, but it didn't work, neither did Thu08Aug.
P> What am I doing wrong? (When I say "the file", I mean the article).
It turns out that "Pnews", a program rn often uses to post netnews,
has a shell environment variable
AUTHORCOPY
If defined, contains the name of a file to which the
finished article will be appended.
Default: article not saved
In your .profile (bash/ksh/sh), you might put
set `date`
AUTHORCOPY=$HOME/.mail/#posted$1$3$2
export AUTHORCOPY
[t]csh users would do something somewhat similar in their .login file.
Re: archeck -- Find your recently posted to newsgroups
Author: Dan_Jacobson
Date: Thu, 08 Aug 1991 23:08
Date: Thu, 08 Aug 1991 23:08
15 lines
1316 bytes
1316 bytes
>>>>> On Thu, 8 Aug 1991 16:34:33 GMT, Dan_Jacobson@ATT.COM said: Dan> set `date` Dan> AUTHORCOPY=$HOME/.mail/#posted$1$3$2 Dan> export AUTHORCOPY Dan> [t]csh users would do something somewhat similar in their .login file. like set x=`date` setenv AUTHORCOPY $HOME/.mail/#posted$x[1]$x[3]$x[2] unset x I suppose.
Re: archeck -- Find your recently posted to newsgroups
Author: Ian Dickinson
Date: Fri, 09 Aug 1991 11:38
Date: Fri, 09 Aug 1991 11:38
19 lines
1617 bytes
1617 bytes
In article <1991Aug8Th123421.Dan_Jacobson@ATT.COM> Dan_Jacobson@ATT.COM writes: >In your .profile (bash/ksh/sh), you might put > >set `date` >AUTHORCOPY=$HOME/.mail/#posted$1$3$2 >export AUTHORCOPY > >[t]csh users would do something somewhat similar in their .login file. Except it will only work if you actually log out every night, and log back in every morning. That doesn't catch people who work overnight, or people who lock their offices/whatever but leave themselves logged in. Cheers, -- \/ato /'\ /`\ Ian Dickinson TED KALDIS FOR PRESIDENT! /^^^\/^^^\ vato@warwick.ac.uk /TWIN/TEATS\ @c=GB@o=University of Warwick@ou=Computing Services@cn=Ian Dickinson / \
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