From 10eb566d6c67a2903b7943905d6d7c24c9f6e506 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Fri, 26 Jan 2007 00:13:43 +0000 Subject: [PATCH] * lurk the faq from our wiki to provide package documentation. --- citadel/contrib/getdoku.sh | 52 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 citadel/contrib/getdoku.sh diff --git a/citadel/contrib/getdoku.sh b/citadel/contrib/getdoku.sh new file mode 100755 index 000000000..55d5e922f --- /dev/null +++ b/citadel/contrib/getdoku.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +BASE_SITE=http://www.citadel.org + + + +#retrieves an index document from the citadel.org website, and filters it +# 1: URL +# 2: outfile where to put the filtered content at +GetIndex() +{ + cd /tmp/; wget -q "${BASE_SITE}/${1}" + cat "/tmp/${1}" | \ + grep /doku.php/ | \ + grep -v "do=" | \ + sed -e "s;.*href=\";;" \ + -e "s;\" .*;;" \ + -e "s;doku.php/;doku.php?id=;"| \ + grep "^/doku" > \ + "/tmp/$2" +} + +rm -f /tmp/mainindex /tmp/doku.php* +GetIndex "doku.php?id=faq:start" mainindex + +for i in `cat /tmp/mainindex`; do + TMPNAME=`echo $i|sed "s;.*=;;"` + echo $i $TMPNAME + mkdir /tmp/$TMPNAME + GetIndex "$i" "$TMPNAME/$TMPNAME" + for j in `cat /tmp/$TMPNAME/$TMPNAME`; do + echo "-----------$j----------------" + cd /tmp/$TMPNAME/; + DOCUMENT_NAME=`echo $j|sed -e "s;/doku.php?id=.*:;;"` + PLAIN_NAME=`grep "$DOCUMENT_NAME" /tmp/doku*$TMPNAME |head -n1 |sed -e "s;','/doku.*;;" -e "s;.*';;"` + + echo "********** retrieving $DOCUMENT_NAME ************" + wget -q "${BASE_SITE}/${j}&do=export_xhtmlbody" + mv "/tmp/$TMPNAME/${j}&do=export_xhtmlbody" /tmp/$TMPNAME/$DOCUMENT_NAME + + echo "
  • $PLAIN_NAME
  • " >>collect_index + echo "" >>collect_bodies + cat $DOCUMENT_NAME>>collect_bodies + done + ( + echo "$TMPNAME" + cat "/tmp/$TMPNAME/collect_bodies" + echo "" + ) >/tmp/`echo $TMPNAME|sed "s;:;_;g"`.html +done \ No newline at end of file -- 2.39.2