🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #240353

SLRN and My_Posts

#240353
From: Lewis
Date: Thu, 08 Apr 2010 23:54
66 lines
3664 bytes
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 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).

I found this from 2007 via google, which is at least sorta similar.

<<<ADAMFUNK
define post_hook ()
{
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));
}

(and the same again in "define followup_hook" and "define
post_file_hook"), because I prefer one file for each post.

You could try like this:

set_string_variable ("save_posts",
sprintf ("/home/michael/news/My_Posts_%d%02d",
tm.tm_year + 1900, tm.tm_mon + 1));

and I think you'd get something similar to what you want.

ADAMFUNK

SO it looks like Adam's macro is at least part of (well, let's be
honest, almost all of) what I want. It does not appear to have the
newsgroup name in the path, however. Is that available?

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?

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 warn you, dragon, the human spirit is-' They never found out what it was, or
at least what he thought it was, although possibly in the dark hours of a
sleepless night some of them might have remembered the subsequent events and
formed a pretty good and gut-churning insight, to whit, that one of the things
sometimes forgotten about the human spirit is that while it is, in the right
conditions, noble and brave and wonderful, it is also, when you get right down
to it, only human. --Guards! Guards!
Technical Details
Message-ID: <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!transit4.hitnews.eu!feeder1.cambriumusenet.nl!feed.tweaknews.nl!209.197.12.242.MISMATCH!nx01.iad01.newshosting.com!newshosting.com!post02.iad!post01.iad!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <slrnhrsr4o.kob.g.kreme@cerebus.local>
Subject: SLRN and My_Posts
Date: Thu, 08 Apr 2010 23:54:01 +0000
From: Lewis <g.kreme@gmail.com.dontsendmecopies>
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!transit4.hitnews.eu!feeder1.cambriumusenet.nl!feed.tweaknews.nl!209.197.12.242.MISMATCH!nx01.iad01.newshosting.com!newshosting.com!post02.iad!post01.iad!not-for-mail
Newsgroups: news.software.readers
Organization: Miskatonic U
Mail-Copies-To: nobody
X-No-Archive: Yes
X-Face: )^b5"R:T7U>9~:PEn3YkzMfW*[b1qKeU.fP9C8~8HpU9}lA&6`bH1z
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Excuse: Been playing lots of WoW
User-Agent: slrn/0.9.9p1 (Darwin)
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Organization: Newshosting.com - Highest quality at a great price!
 www.newshosting.com
X-Complaints-To: abuse(at)newshosting.com
Lines: 66