🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
2 messages
2 total messages Started by Jon Mansey Sun, 14 Feb 1999 00:00
delayed feed howto?
#35426
Author: Jon Mansey
Date: Sun, 14 Feb 1999 00:00
10 lines
793 bytes
Hi,

Anyone have any pointers to information on how to set up a delayed feed
under INN2.0?

Much Appreciated,

Jon.

Re: delayed feed howto?
#35452
Author: christian mock
Date: Mon, 15 Feb 1999 00:00
91 lines
2650 bytes
In article <jon-1402992141000001@192.168.2.3>,
Jon Mansey <jon@nospaMinterpacket.net> wrote:
> Hi,
> 
> Anyone have any pointers to information on how to set up a delayed feed
> under INN2.0?

I use this piece of perl.

ciao,

cm.

#!/usr/bin/perl
# -*- perl -*-
#
# delay lines for N seconds.
#
# primarily meant to be used with INN to generate a delayed feed with innfeed.
#
# put it into your newsfeeds file like
#
# innfeed-delayed!\
#        :!*\
#        :Tc,Wnm*,S16384:/usr/local/news/bin/delayer 60 \
#		/usr/local/news/bin/startinnfeed -c innfeed-delayed.conf
#
#
#
# done by christian mock <cm@tahina.priv.at> sometime in july 1998,
# and put into the public domain.
#
$delay = shift || die "usage: $0 delay prog-n-args\n";

$timeout = $delay;
$eof = 0;

open(OUT, "|" . join(" ", @ARGV)) || die "open |prog-n-args: $!\n";

#select(OUT);
#$| = 1;
#select(STDOUT);

$rin = '';
vec($rin,fileno(STDIN),1) = 1;

while(!$eof || $#queue >= 0) {
    if(!$eof) {
	($nfound,$timeleft) =
	    select($rout=$rin, undef, undef, $timeout);
    } else {
	sleep($timeout);
    }
    $now = time(); $exp = $now + $delay;

    if(!$eof && vec($rout,fileno(STDIN),1)) {
	$line = <STDIN>;
	if(!defined $line) {	# exit NOW!
	    foreach(@queue) {
		s/^[^:]+://g;
		print OUT;
	    }
	    close(OUT);
	    sleep(1);
	    exit;
	}
	push(@queue, "$exp:$line");
    }

    if($#queue < 0) {
	undef $timeout;
	next;
    }

    ($first, $line) = split(/:/, $queue[0], 2);
    while($#queue >= 0 && $first <= $now) {
	print OUT $line;
	shift(@queue);
	($first, $line) = split(/:/, $queue[0], 2);
    }
    $timeout = $first - $now;
	
}

-- 
christian mock @ home in vienna, austria
   sind fremdcancels strafbar? -> http://www.tahina.priv.at/bincancel/
Those silly RFCs are all that separate us from the animals!
                                          -- Kevin Rodgers in a.r.e

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