🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #240360

Re: SLRN and My_Posts

#240360
From: Adam Funk
Date: Fri, 09 Apr 2010 19:26
75 lines
3558 bytes
On 2010-04-08, Lewis wrote:

> slrn saves the posts into a single file, I'd prefer that each post be
> saved in an individual file, something like this:
>
> ~/News/Posts/20010/04/news.software.readers/20100408.172346

I think (but I'm not certain) that the problem there is that it would
sometimes require slrn to save a file in a directory that doesn't
exist yet, and I doubt that slrn's file-saving can create new
directories.  (Most *n*x software IME doesn't automatically create
directories for a file-save.)  Maybe someone else can correct or
confirm this?

> I can construct that path logically, but I have no idea how to even run
> a macro in slrn (I know it can do it, in theory, but haven't gotten that
> far).

When I started reading this post, I thought, "Hey, I've done something
similar --- maybe I can help!"  But as you said:


> I found this from 2007 via google, which is at least sorta similar.
...[snip quote from ADAM FUNK]
> Then I just throw the code into something like $HOME/.saveposts.sl and
> add interpret "$HOME/.saveposts.sl" to the .slrnrc? Or does the file
> need to go somewhere special? And when Adam said "the same again" I
> would end up wiht three define functions in the .sl file, right? Then
> what do I set in the .slrcrc file for save_posts and save_replies? Leave
> them commented out?

Here's exactly what I have now.  This is in my ~/.slrnrc file:

#v+
interpret ".slrn/macros.sl"
#v-

and this is in my ~/.slrn/macros.sl file (along with other things):

#v+
define fudge_save_file () {
    variable tm = localtime (_time ());
    set_string_variable ("save_posts",
       sprintf ("/home/adam/News/sent/%d%02d%02d-%02d%02d%02d.news",
          tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
          tm.tm_hour, tm.tm_min, tm.tm_sec));
}

register_hook("post_hook", "fudge_save_file");
register_hook("post_file_hook", "fudge_save_file");
register_hook("followup_hook", "fudge_save_file");
#v-



> OK, one last question before I go, is there a reason to use
> localtime(__time ()); or could I use the more familiar (to me) date
> command to build the string?
>
> something like 
>
> {
>   variable MyDate = `date 'date +%Y%m%d-%H%M%S'`
>   variable MyFile = <slrn newsgroup name>-$MyDate;
>   set_string_variable ("save_posts", "/path/to/my/news/posts/${MyFile}");
> }

I don't know; I didn't try it!


-- 
Taken on the whole however this is a fine disc and a good example of
the current pop scene attempting to break out of its vulgarisms and
sometimes downright obscene derivative hogwash.
                                     (Julian Stone-Mason B.A., 1972)
Technical Details
Message-ID: <fkb497xbbu.ln2@news.ducksburg.com>
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!border1.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
References: <slrnhrsr4o.kob.g.kreme@cerebus.local>

Show Full Headers
Complete Article Headers
Message-ID: <fkb497xbbu.ln2@news.ducksburg.com>
Subject: Re: SLRN and My_Posts
Date: Fri, 09 Apr 2010 20:26:39 +0100
From: Adam Funk <a24061@ducksburg.com>
References: <slrnhrsr4o.kob.g.kreme@cerebus.local>
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!border1.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
Newsgroups: news.software.readers
Organization: $CABAL
Lines: 75
X-Trace: individual.net mhSUy/sK6JjiM3K3OvWFLAy96h+B8//7RE2G8ISLSsR6hg2opZ
X-Orig-Path: news.ducksburg.com!not-for-mail
Cancel-Lock: sha1:rrdT2g7AE0ydhY9OFumGg19r1Eg=
 sha1:ej9XHX4CT1/uYTPdFXnBFez/OA0=
User-Agent: slrn/pre1.0.0-16/mm/ao (Ubuntu Intrepid)