Article View: news.software.readers
Article #241828Re: [slrnpull] Logging of retrieved articles?
From: ernobe
Date: Sat, 24 Jul 2010 21:25
Date: Sat, 24 Jul 2010 21:25
85 lines
4174 bytes
4174 bytes
> I'm thinking of delving into the slrnpull code to see if I can keep a log of
> retrieved messages. These could be used as part of my clean threads macro (
> mentioned in the true offline mode thread ) so that the new messages
> can be tagged, and threads will then show read, unread, and new messages.
> Does anyone have any ideas on how to go about this?
>
I don't know how to do it with S-Lang, but here is Icon code (
http://cs.arizona.edu/icon ) that will do it. If you use Linux/Unix your
distribution probably has custom made packages for it, or else it is easy to
install from the website. This program produces three files in the directory
it is run in: all headers, all bodies, and new bodies. It takes a single
argument, and that is the directory path of the slrnpull spool directory for
the group. To be on the safe side don't end the path with a slash. The names
of the files produced is taken from the directory path, and consists of all
the letters following the slashes. This has been tested on my Debian unstable
installation. It will require some tweaking for a Windows installation
because the details of accessing the files and writing to the directories
varies. In the first run, the yourdirname-allbodies and yourdirname-newbodies
files will be identical since all bodies are new bodies. Then go to slrn,
request some bodies for that group, and re-run the program in the same
directory you ran it the first time (after getting the bodies with slrnpull).
The yourdirname-newbodies file should have the header numbers of the new
messages.
procedure main( s )
f := \s[ 1 ] | stop( "missing directory argument" )
g := ""
k := []
iii := []
yyy := []
f ? { while tab( upto( '/' ) + 1 ) do {
g ||:= move( 1 ) }
}
g1 := g || "-spool"
g2 := g || "-bodies"
g3 := g || "-allbodies"
g4 := g || "-newbodies"
system( "ls " || f || " > " || g1 )
n := open( f || "/.headers", "rw" ) | stop( "unable to open directory" )
i := open( g1, "rw" )
j := open( g2, "crw" )
y := open( g3, "rw" | "crw" )
s := open( g4, "crw" )
nn := read( n )
close( n )
nn ? {
repeat {
nnn := tab( upto( ',' ) | 0 )
if numeric( nnn ) then {
put( k, integer( nnn ) )
move( 1 ) | break
next
}
nnn ? {
kk := integer( tab( upto( '-' ) ) )
move( 1 )
kkk := integer( tab( 0 ) )
put( k, kk )
while kk +:= 1 do {
put( k, kk )
if kk = kkk then break
}
}
move( 1 ) | break }
}
while ii := read( i ) do {
put( iii, integer( ii ) ) }
while yy := read( y ) do {
put( yyy, integer( yy ) ) }
jj := set( iii ) -- set( k )
ss := jj -- set( yyy )
every write( j, !jj )
every write( s, !ss )
close( j )
close( y )
system( "mv " || g2 || " " || g3 )
end
--
"The world of existence is an emanation of the merciful attribute of God."
Abdu'l-Baha
http://www.costarricense.cr/pagina/ernobe
Technical Details
Message-ID:
<i2floq$gtt$1@news.eternal-september.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!num2.nntp.dca.giganews.com!num1.nntp.dca.giganews.com!number.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.buerger.net!newsfeed.datemas.de!eternal-september.org!.POSTED!not-for-mailReferences:
<i2chko$f8$1@news.eternal-september.org>Show Full Headers
Complete Article Headers
Message-ID: <i2floq$gtt$1@news.eternal-september.org> Subject: Re: [slrnpull] Logging of retrieved articles? Date: Sat, 24 Jul 2010 21:25:46 +0000 From: ernobe <ernobe@yahoo.com> References: <i2chko$f8$1@news.eternal-september.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!num2.nntp.dca.giganews.com!num1.nntp.dca.giganews.com!number.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.buerger.net!newsfeed.datemas.de!eternal-september.org!.POSTED!not-for-mail Newsgroups: news.software.readers Organization: Baha'i Faith Lines: 85 Injection-Date: Sat, 24 Jul 2010 21:25:46 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="JELnH+BdEro/urHfghrQkg"; logging-data="17341"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+h5Ld3U8xGHEKlgPPNqBPheASzw790asA=" User-Agent: slrn/pre1.0.0-18 (Linux) Cancel-Lock: sha1:aJmsC1MCKa2DOY9bQ97VbmECWjQ= X-Original-Bytes: 3874