tail / rsstail-like

To have a "tail(1) -f"-like FIFO stream filtering for new unique feed items and
showing them as plain-text per line similar to sfeed_plain(1):

Create a FIFO (setup.sh):

	fifo="/tmp/sfeed_fifo"
	mkfifo "$fifo"

On the reading side (read.sh):

	while :; do cat "$fifo" || sleep 1; done | awk '!x[$0]++'

On the writing side (write.sh):

	feedsdir="$HOME/.sfeed/feeds/"
	cd "$feedsdir" || exit 1
	test -p "$fifo" || exit 1

	# 1 day is old news, don't write older items.
	awk -F '\t' -v "old=$(($(date +'%s') - 86400))" '
	BEGIN { OFS = "\t"; }
	int($1) >= old {
		$2 = "[" FILENAME "] " $2;
		print $0;
	}' * | sort -k1,1n | sfeed_plain | cut -b 3- > "$fifo"

* Run setup.sh
* Run read.sh, keep this script open.
* Run sfeed_update and write.sh in some interval repeatedly.

An idea: you can pipe this output to some IRC channel using the FIFO IRC client
ii to have some sort of notification system to IRC: https://git.suckless.org/ii/
