% -*- mode: slang; mode: fold; -*-
%
%{{{ Description:
% HEADERS incl. random MESSAGE ID [slrn + jed]
% When posting to a newsgroup one sometimes needs to look through
% some other posts (to quote from miscellaneous articles, include msgid's,
% etc). That is why it is rather convenient to write the post on one
% console/xterm having slrn handy on another. The following macros add
% necessary headres and create a random message id.
%
% USAGE:
% Put your data in the macro. USER is your username, and YOUR.DOMAIN is your
% domain name (important for scoring), etc
%
% Put the macro in /usr/local/jed/lib/mymacros.sl,
% and add the following to .jedrc:
%
% () = evalfile ("mymacros.sl");
%
% How to use it:
%
% 1. [slrn] call followup
% 2. [jed] save the buffer to /var/spool/slrnpull/out.going/name
% "name" should have the following form:
% "Xa-b-c.USER, where a,b,c are any numbers, and USER is any txt
% string, eg. "X324-234-23.sdf"
% 3. [jed] exit
% 4. [slrn] say No to posting the message, continue with reading news/checking
% what you need to compose your post
% 5. [jed] on another console/xterm write and save your article. Before saving
% do ESC-x naglowki ENTER
% 6. [slrnpull] simply do slrnpull -h news.server.u.use --post
% 7. that's all
%
% If you use sth else than slrnpull for posting, ignore [2], and name the
% file as you want.
%
% 17.01.2000 Frank v Waveren suggested _time();
%
% Yahoo! Geocities disallows *.sl extensions, and corrupts *.sl.gz
% files. That is why this file has a *.txt extension. You might want
% to change it back to *.sl
%
% Tomasz 'tsca' Sienicki
%
%}}}
define wstaw_if_nonexistant (x,y)
{
bob ();
re_fsearch ("^$");
!if(re_bsearch (sprintf("^%s: ",x,1)))
{
(insert(sprintf("%s: %s\n",x,y,2)));
}
}
define naglowki()
{
() = random (-1, 0);
wstaw_if_nonexistant("From","John Doe ");
wstaw_if_nonexistant("Subject","");
wstaw_if_nonexistant("Newsgroups","");
wstaw_if_nonexistant("Content-Transfer-Encoding","8bit");
wstaw_if_nonexistant("Content-Type","text/plain; charset=iso-8859-2");
wstaw_if_nonexistant("Mime-Version","1.0");
wstaw_if_nonexistant("Organization","my organisation");
wstaw_if_nonexistant("Followup-To","");
wstaw_if_nonexistant("User-Agent","slrn/0.9.5.7 (Linux)");
wstaw_if_nonexistant("Message-ID",
Sprintf ("",
_time (), random (0, 99), random (0, 999),3));
}
               (
geocities.com/tsca.geo)