updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / arch-wiki-docs-fr / get.sh
blob35f74386eb375472d590a04636959683d445ceea
1 #!/bin/sh
3 TARGETDIR=$2
5 mkdir -p $TARGETDIR
7 cat >$TARGETDIR/index.html <<EOF
8 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
9 <HTML>
10 <HEAD>
11 <TITLE>ArchWiki index</TITLE>
12 <META http-equiv="content-type" content="text/html; charset=utf-8"/>
13 </HEAD>
14 <BODY>
15 EOF
17 $1/index.pl http://wiki.archlinux.fr | while read A; do
18 TITLE=`echo $A | cut -d \ -f 2- | tr ' ' '_'`
19 ID=`echo $A | cut -d \ -f 1`
20 echo "$ID => $TITLE"
21 echo "<P><A HREF='$ID.html'>$TITLE</A>" >>$TARGETDIR/index.html
22 [ -f "$TARGETDIR/$ID.html" ] || wget -q "http://wiki.archlinux.fr/index.php?title=$TITLE&printable=yes" -O "$TARGETDIR/$ID.html"
23 done
25 echo "</BODY></HTML>" >>$TARGETDIR/index.html