🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #180261

Re: [slrn] interpolating a date in save_posts and save_replies

#180261
From: Troy Piggins
Date: Tue, 07 Feb 2006 02:25
57 lines
3119 bytes
* Troy Piggins wrote:
> * Adam Funk wrote:
>> I've got the following in ~/.slrnrc now:
>>
>> set save_posts   ".slrn/news.sent"
>> set save_replies ".slrn/mail.sent"
>>
>> I'd like to know if it's possible to put into those values a variable
>> for the date, ideally in YYYYMMDD format, so that instead of having
>> one file of all my posts, I get a separate file for each day,
>> for exampled ~/.slrn/20060203.sent.news for today.
>
> I saw PJR's sed solution and that may work for you, but I was thinking
> about a macro along the lines of what I use for custom message id's :
>
[snip]

I should have mentioned my reason for preferring to do it this way -
it's all within slrn and a macro you add in s-lang, and you don't need
to add a cron job or external script, and it updates itself every time
you post.

Tested and working now:

> define post_hook ()
> {
>  variable tm = localtime (_time ());
>  set_string_variable ("save_posts",
>   sprintf ("/home/troy/.slrn/%d%02d%02d.sent.news",
              ^^^^^^^^^^
Changed this to full path rather than ~/.slrn shorthand (for some reason
slrn didn't like it the other way)

>    tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday));
>  set_string_variable ("save_replies",
>   sprintf ("/home/troy/.slrn/%d%02d%02d.sent.mail",
              ^^^^^^^^^^

>    tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday));
> }

I put it in my /home/troy/.slrn/macros.sl file.  I already have some
post_hooks defined, so inserted the above inside the already existing
hook.  If you don't already have macros/hooks defined, or don't know
what I'm talking about, then you could just add the above to a file
/home/xxxx/.slrn/macros.sl , and add this line to the beginning of your
$HOME/.slrnrc :

interpret /home/xxxx/.slrn/macros.sl

Hope that makes sense.  If not, let me know.

-- 
Troy Piggins
Ubuntu 5.10  pkgs : kernel 2.6.12-9-386, postfix 2.2.4, procmail 3.22
Compiled from src : slrn 0.9.8.1/rt (score_color patch), mutt 1.5.11i
                      vim 6.4
Technical Details
Message-ID: <20060207121558@usenet.piggo.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!number1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news1.optus.net.au!optus!news.uwa.edu.au!nntp.waia.asn.au!203.59.27.186.MISMATCH!newsfeed.iinet.net.au!newsfeed.iinet.net.au!per-qv1-newsstorage1.iinet.net.au!per-qv1-newsstorage1.iinet.net.au!per-qv1-newsreader-01.iinet.net.au!not-for-mail
References: <73pbb3-uk6.ln1@news.ducksburg.com> <20060206112441@usenet.piggo.com>

Show Full Headers
Complete Article Headers
Message-ID: <20060207121558@usenet.piggo.com>
Subject: Re: [slrn] interpolating a date in save_posts and save_replies
Date: Tue, 07 Feb 2006 02:25:30 +0000
From: Troy Piggins <usenet-0602@piggo.com>
References: <73pbb3-uk6.ln1@news.ducksburg.com> <20060206112441@usenet.piggo.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!number1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news1.optus.net.au!optus!news.uwa.edu.au!nntp.waia.asn.au!203.59.27.186.MISMATCH!newsfeed.iinet.net.au!newsfeed.iinet.net.au!per-qv1-newsstorage1.iinet.net.au!per-qv1-newsstorage1.iinet.net.au!per-qv1-newsreader-01.iinet.net.au!not-for-mail
Newsgroups: news.software.readers
Reply-To: usenet-0602@piggo.com
User-Agent: slrn/0.9.8.1/rt (Linux)
Lines: 57
NNTP-Posting-Host: 203.206.99.212
X-Trace: 1139279130 per-qv1-newsreader-01.iinet.net.au 30424 203.206.99.212