From e5571d8b63466a0acb918c45f3adbbcd3a2846ac Mon Sep 17 00:00:00 2001 From: encrypt Date: Mon, 29 Jun 2015 01:04:14 +0200 Subject: [PATCH] add prcd2fortune --- prcd2fortune/prcd.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 prcd2fortune/prcd.sh diff --git a/prcd2fortune/prcd.sh b/prcd2fortune/prcd.sh new file mode 100644 index 0000000..bf4103c --- /dev/null +++ b/prcd2fortune/prcd.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# 'njoy +tmp="/tmp/prcd/" +wget "http://www.papuasia.org/prcd/" -nd -r -np -A txt -P $tmp + +for f in $tmp* +do + nf=$(echo $f | cut -d '.' -f 1) + cat $f | tr '\n' '\0' | xargs -0 -L1 -I '$' printf '$\n%%\n' > "$nf" + strfile $nf +done + +rm $tmp*.txt +mv $tmp* /usr/share/fortune/ +rm -rf $tmp