🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #180206

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

#180206
From: Troy Piggins
Date: Mon, 06 Feb 2006 01:40
44 lines
2530 bytes
* 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 :

static define create_msg_id (uname)
{
   variable tm = localtime (_time ());
   if (0 == strlen (uname))
     return;
   return sprintf ("%d%02d%02d%02d%02d%02d@%s.piggo.com",
                   tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
                   tm.tm_hour, tm.tm_min, tm.tm_sec, uname);
}

Hacked for your purposes (not tested) :

define post_hook ()
{
 variable tm = localtime (_time ());
 set_string_variable ("save_posts",
  sprintf ("~/.slrn/%d%02d%02d.sent.news",
   tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday));
 set_string_variable ("save_replies",
  sprintf ("~/.slrn/%d%02d%02d.sent.mail",
   tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday));
}

Put that in a file and include in .slrnrc as usual.

-- 
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: <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
References: <73pbb3-uk6.ln1@news.ducksburg.com>

Show Full Headers
Complete Article Headers
Message-ID: <20060206112441@usenet.piggo.com>
Subject: Re: [slrn] interpolating a date in save_posts and save_replies
Date: Mon, 06 Feb 2006 01:40:15 +0000
From: Troy Piggins <usenet-0602@piggo.com>
References: <73pbb3-uk6.ln1@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!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: 44
NNTP-Posting-Host: 203.206.55.111
X-Trace: 1139190015 per-qv1-newsreader-01.iinet.net.au 30437 203.206.55.111