🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #56538

Re: [slrn] howto update counter in hook?

#56538
From: Rejo Zenger
Date: Fri, 07 Jan 2000 00:00
79 lines
3463 bytes
++ <slrn87aa5f.nas.davis@aluche.mit.edu>; John E. Davis:
>>I'm trying to have an address in my header that is uniq at every post
>>that i do. I thunk i can get this by having sa number in file that gets
>>increased every time i do a post. The number is inserted in my address i
>
>What about using the current time?

Well, at first i did not think it was a good idea, however i have
changed my mind and i'm trying to get the date and time in my address.

So, what i think i will do now is to have a cron entry putting the
output of 'date +%s' in a cache-file. Then i want that output to be
inserted in my address whenever i do a post.

Instead of rejo+f@sisterray.xs4all.nl, the address should be something
like rejo+f947236200@sisterray.xs4all.nl. The editted script i have now
is:

---------------------------------------------------------------------------
variable Default_username;
variable Default_replyto;

Default_username = get_variable_value ("username");
Default_replyto = get_variable_value ("replyto");

define post_hook ()
{
   variable cache_file = "/home/rejo/news/cache.txt";
   variable file_open = fopen (cache_file, "r");
   variable x;

   if (file_open == NULL)
     {
        () = fprintf (stderr, "Unable to open %s\n", cache_file);
        return -1;
     }
   
   while (-1 != fgets (&x, file_open))
     {

        variable a;
	a = Default_username;
        a = sprintf ("rejo.f%d%s", x, a);
        set_string_variable ("username", a);

      }

   () = fclose (file_open);
   return 0;
}
---------------------------------------------------------------------------



>    Do you mean:
>    
>           a = sprintf ("rejo.f%d%s", y, a);

I'mn not sure here as i don't understand exactly what this will do, i
will try to look it up in the manual first before replying to this one.

>See http://space.mit.edu/%7Edavis/slang1.4-doc.html for more
>information.

Which is, i guess, the same as /usr/doc/package/slang/slang.txt?


Thanks a lot for your help... it's pretty hard to read stuff for someone
that doesn't have any experience with coding... :-)

	-Rejo.

-- 
= Rejo Zenger  [Sister Ray Crisiscentrum]               rejo@sisterray.xs4all.nl
= http://mediaport.org/~sister (and my_urls.html)               PGP: see headers
--------------------------------------------------------------------------------
  Destroy a spamhaus! http://www.xs4all.nl/~sister/mirror/sengir/spam_sites.html

Technical Details
Message-ID: <slrn87bbp0.15s.rejo@sisterray.xs4all.nl>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
References: <slrn87a8om.16h.rejo.f0001nim@sisterray.xs4all.nl> <slrn87aa5f.nas.davis@aluche.mit.edu>

Show Full Headers
Complete Article Headers
Message-ID: <slrn87bbp0.15s.rejo@sisterray.xs4all.nl>
Subject: Re: [slrn] howto update counter in hook?
Date: Fri, 07 Jan 2000 00:00:00 +0000
From: rejo@sisterray.xs4all.nl (Rejo Zenger)
References: <slrn87a8om.16h.rejo.f0001nim@sisterray.xs4all.nl> <slrn87aa5f.nas.davis@aluche.mit.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
X-Deja-AN: 569472303
X-PGP-Id: ELG-E/DSS 0x75FC50F3, DSS/DH 0x2C8059B5, RSA 0xFAE40065
X-Complaints-To: abuse@xs4all.nl
X-Trace: news1.xs4all.nl 947236844 21848 194.109.57.59 (7 Jan 2000 09:20:44 GMT)
Organization: Sister Ray Zenuwcentrum
X-PGP-Keys: Available at keyserver and website or finger <sister@xs4all.nl>
User-Agent: slrn/0.9.5.7 (UNIX)
NNTP-Posting-Date: 7 Jan 2000 09:20:44 GMT
Newsgroups: news.software.readers