#!/bin/bash
#
# get-pages.sh
# 
# Copyright (C) 2006  Josef Kufner <jk@myserver.cz>
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# 

dir=wiki

mkdir "$dir" && cd "$dir" || exit

while read url
do
	[ -z "$url" ] || wget -nv -p -k -E -nc -nd --post-data printable=yes "$url"
done <<end-of-page-list
http://jk.myserver.cz/wiki/Net_Board
http://jk.myserver.cz/wiki/Net_Board/Z_pohledu_u%C5%BEivatele
http://jk.myserver.cz/wiki/Net_Board/Z_pohledu_program%C3%A1tora
end-of-page-list

locale | grep -iq utf || convmv -f 'utf-8' -t 'latin2' -r ./ --notest

sed	-e 's|\<href="http://jk.myserver.cz/wiki/Net_Board/\([^#"]\+\)\(.\)|href="./\1.html\2|g' \
	-e 's|\<href="http://jk.myserver.cz/wiki/Net_Board\([#"]\)|href="./Net_Board.html\1|g' \
	-i ./*


