🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #180295

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

#180295
From: Troy Piggins
Date: Tue, 07 Feb 2006 21:48
68 lines
3475 bytes
* Adam Funk wrote:
> On 2006-02-07, Troy Piggins <usenet-0602@piggo.com> wrote:
>
>>> 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 don't know s-lang: what would I need to add HHMMSS time to that
> string as well?  (I understand sprintf.)

My first post had an example in there of how I create custom
message-ids, and that had hours, mins, and secs:

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);
}

If you understand sprintf then this should make sense to you.

http://www.s-lang.org/doc/html/slangfun-11.html

Your OP only asked for yyyymmdd format so that's what I provided, and
saving sent items with smaller granularity than that doesn't really make
much sense unless you're posting hundreds/thousands of posts per day.

Is there another implementation you need the hrs/mins/sec ?

>> 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.
>
> Yes, I'll try it.
>
> Thanks!

NP.  Peace.

-- 
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: <20060208071917@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> <20060207121558@usenet.piggo.com> <9vvmb3-hvp.ln1@news.ducksburg.com>

Show Full Headers
Complete Article Headers
Message-ID: <20060208071917@usenet.piggo.com>
Subject: Re: [slrn] interpolating a date in save_posts and save_replies
Date: Tue, 07 Feb 2006 21:48:32 +0000
From: Troy Piggins <usenet-0602@piggo.com>
References: <73pbb3-uk6.ln1@news.ducksburg.com> <20060206112441@usenet.piggo.com> <20060207121558@usenet.piggo.com> <9vvmb3-hvp.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: 68
NNTP-Posting-Host: 203.206.118.146
X-Trace: 1139348912 per-qv1-newsreader-01.iinet.net.au 30432 203.206.118.146