Thread View: news.software.readers
12 messages
12 total messages
Started by Lewis
Thu, 08 Apr 2010 23:54
SLRN and My_Posts
Author: Lewis
Date: Thu, 08 Apr 2010 23:54
Date: Thu, 08 Apr 2010 23:54
66 lines
3664 bytes
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!
Re: SLRN and My_Posts
Author: W. Citoan
Date: Fri, 09 Apr 2010 02:05
Date: Fri, 09 Apr 2010 02:05
39 lines
2760 bytes
2760 bytes
Lewis wrote: > > 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? Yes, the current_newsgroup() funtion, I believe. You should take a look at the Slrn Intrinsic Function Reference Manual: http://slrn.sourceforge.net/docs/slrnfuns.html > 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? Correct; the file does not 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? Sounds like it. The available hooks are defined in the Intrinsic Function Reference Manual. > Then what do I set in the .slrcrc file for save_posts and > save_replies? Leave them commented out? Shouldn't matter. The hook function will overwrite them. > 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? Not sure, but I think you need to stick with SLRN (or SLANG) functions. I don't know that SLRN supports external command substitution. Easy to test and find out though. - W. Citoan -- Genius is one percent inspiration and ninety-nine percent perspiration. -- Thomas A. Edison
Re: SLRN and My_Posts
Author: Lewis
Date: Fri, 09 Apr 2010 05:44
Date: Fri, 09 Apr 2010 05:44
20 lines
2133 bytes
2133 bytes
In message <slrnhrt2ql.50o.wcitoan@wcitoan-via.eternal-september.org> W. Citoan <wcitoan@NOSPAM-yahoo.com> wrote: > Lewis wrote: >> >> 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? > Yes, the current_newsgroup() funtion, I believe. You should take a look > at the Slrn Intrinsic Function Reference Manual: > http://slrn.sourceforge.net/docs/slrnfuns.html Ah, yes, thank you. I should have checked there. Thanks for the reply. I will muck about with the documentation. -- Otto: Apes don't read philosophy. Wanda: Yes, they do Otto, they just don't understand it.
Re: SLRN and My_Posts
Author: Adam Funk
Date: Fri, 09 Apr 2010 19:26
Date: Fri, 09 Apr 2010 19:26
75 lines
3558 bytes
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)
Re: SLRN and My_Posts
Author: Whiskers
Date: Fri, 09 Apr 2010 20:16
Date: Fri, 09 Apr 2010 20:16
24 lines
2027 bytes
2027 bytes
On 2010-04-08, Lewis <g.kreme@gmail.com.dontsendmecopies> wrote: > slrn saves the posts into a single file, Actually, it's standard mbox format. Slrn can't read those files, but email programs have no difficulty. > 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 don't know if looking for tools to convert mbox to maildir or MH format would help you. There seem to be a few Perl scripts out there. You seem to be trying to create something very much like a news-spool; if you are using eg slrn-pull or Leafnode, you already have one ... it's what slrn reads /from/. -- -- ^^^^^^^^^^ -- Whiskers -- ~~~~~~~~~~
Re: SLRN and My_Posts
Author: Troy Piggins
Date: Fri, 09 Apr 2010 21:30
Date: Fri, 09 Apr 2010 21:30
50 lines
2746 bytes
2746 bytes
* Whiskers wrote :
> On 2010-04-08, Lewis <g.kreme@gmail.com.dontsendmecopies> wrote:
>> slrn saves the posts into a single file,
>
> Actually, it's standard mbox format. Slrn can't read those files, but
> email programs have no difficulty.
<snip />
My solution to this was to write macros to invoke mutt when I
wanted to read them. Edit the paths to suit. Ctrl-T in slrn
will invoke mutt to view your posts, Ctrl-R in slrn will invoke
mutt to view your replies, quitting mutt will return you to slrn.
#v+
% Filename: view_my_posts.sl
% Version: 0.9.1
% Author: Troy Piggins
% assumes you are have mutt mail reader
% check the paths to "save_posts" and "save_replies" are correct
define view_my_posts() {
% path to your posts, ie the value of "save_posts" in your
% .slrnrc
variable postpath= "$HOME/news/My_Posts";
() = system ("mutt -f "+postpath);
}
definekey ("view_my_posts", "^T", "article");
definekey ("view_my_posts", "^T", "group");
define view_my_mails() {
% path to your mails, ie the value of "save_replies" in your
% .slrnrc
variable mailpath= "$HOME/news/My_Replies";
() = system ("mutt -f "+mailpath);
}
definekey ("view_my_mails", "^R", "article");
definekey ("view_my_mails", "^R", "group");
#v-
--
Troy Piggins
Re: SLRN and My_Posts
Author: Theodore Heise
Date: Sat, 10 Apr 2010 17:13
Date: Sat, 10 Apr 2010 17:13
23 lines
1955 bytes
1955 bytes
On Sat, 10 Apr 2010 07:30:06 +1000, Troy Piggins <usenet-1004@piggo.com> wrote: > * Whiskers wrote : >> On 2010-04-08, Lewis <g.kreme@gmail.com.dontsendmecopies> wrote: >>> slrn saves the posts into a single file, >> >> Actually, it's standard mbox format. Slrn can't read those >> files, but email programs have no difficulty. > My solution to this was to write macros to invoke mutt when I > wanted to read them. Edit the paths to suit. Ctrl-T in slrn > will invoke mutt to view your posts, Ctrl-R in slrn will invoke > mutt to view your replies, quitting mutt will return you to > slrn. Pine will also read the files created by slrn. If you have need to split a concatenated mail file, "formail" (a part of procmail) may be helpful. -- Theodore (Ted) Heise <theo@heise.nu> Bloomington, IN, USA
Re: SLRN and My_Posts
Author: Adam Funk
Date: Sat, 10 Apr 2010 19:10
Date: Sat, 10 Apr 2010 19:10
31 lines
2068 bytes
2068 bytes
On 2010-04-09, Whiskers wrote: > On 2010-04-08, Lewis <g.kreme@gmail.com.dontsendmecopies> wrote: >> slrn saves the posts into a single file, > > Actually, it's standard mbox format. Slrn can't read those files, but > email programs have no difficulty. Yes, but mbox format is (IMO, anyway) rubbish. It's really the only thing I hate about Thunderbird. >> 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 don't know if looking for tools to convert mbox to maildir or MH format > would help you. There seem to be a few Perl scripts out there. > > You seem to be trying to create something very much like a news-spool; if > you are using eg slrn-pull or Leafnode, you already have one ... it's what > slrn reads /from/. I agree with the OP; I want my sent posts saved in this maildir-like way for good greppability and reasonable file size. -- Take it? I can't even parse it! [Kibo]
Re: SLRN and My_Posts
Author: darkside
Date: Sun, 11 Apr 2010 06:37
Date: Sun, 11 Apr 2010 06:37
20 lines
1960 bytes
1960 bytes
On 2010-04-09, Adam Funk <a24061@ducksburg.com> wrote: > 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 Hi, sorry if I did not understand well .... my english is not so good ... I'm using , as email client , mutt. I created a directory : /home/my_user/Mail/Slrn/name_of_news_group With option letter O , I save all my question-posts, replies, and all interesting posts which I want to keep. So, it's very useful to read all posts, with subject , replies, one by one. Sorry if this in not the solution you need ... Bye.
Re: SLRN and My_Posts
Author: Lewis
Date: Sun, 11 Apr 2010 07:30
Date: Sun, 11 Apr 2010 07:30
49 lines
3023 bytes
3023 bytes
In message <fkb497xbbu.ln2@news.ducksburg.com>
Adam Funk <a24061@ducksburg.com> wrote:
> 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?
That is a frequent problem. In procmail I would do something like...
FAKEVAR=`test -d $HOME/path || mkdir $HOME/path`
But I still know nothing about slang2
> #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-
Ah, that's shorter than what I did.
What's the #v+/#v-?
--
"He has never been known to use a word that might send a reader to the
dictionary." - William Faulkner (about Ernest Hemingway).
Re: SLRN and My_Posts
Author: andrew
Date: Sun, 11 Apr 2010 08:24
Date: Sun, 11 Apr 2010 08:24
14 lines
1519 bytes
1519 bytes
On 2010-04-11, Lewis <g.kreme@gmail.com.dontsendmecopies> wrote: > What's the #v+/#v-? Verbatim marks: http://slrn.sourceforge.net/docs/slrn-manual-6.html#process_verbatim_marks by default these are bound to the '[' key. Andrew -- Do you think that's air you're breathing?
Re: SLRN and My_Posts
Author: Adam Funk
Date: Sun, 11 Apr 2010 20:23
Date: Sun, 11 Apr 2010 20:23
35 lines
2023 bytes
2023 bytes
On 2010-04-11, Lewis wrote: > Adam Funk <a24061@ducksburg.com> wrote: >> 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? > > That is a frequent problem. In procmail I would do something like... > > FAKEVAR=`test -d $HOME/path || mkdir $HOME/path` AIUI, you could just do `mkdir -p $HOME/path`, at least with GNU mkdir; it should silently do nothing if the path already exists (as a directory, of course). > But I still know nothing about slang2 I don't know much! >> #v+ >> interpret ".slrn/macros.sl" >> #v- ... > What's the #v+/#v-? It means "verbatim" (I assume!) and is a semi-standard way of quoting code, shell input & output, &c. -- Take it? I can't even parse it! [Kibo]
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads