#! /bin/sh
#
# Rebuild all sites
#
# $@ are additional arguments to ./get_site
# 
# Praat
./get_site --no-parent -p $@ http://www.fon.hum.uva.nl/praat/
# Construct Praat manual site and pdf
./get_site --no-parent -p $@ http://www.fon.hum.uva.nl/praat/manual/Intro.html
(html2ps -n -W L10 www.fon.hum.uva.nl/praat/manual/Intro.html |ps2pdf - > Literature/praat_manual.pdf)&
# Sidney Wood's beginners guide to praat
./get_site --no-parent -p $@ http://www.ling.lu.se/persons/Sidney/praate/index.html
(html2ps -n -W L10 www.ling.lu.se/persons/Sidney/praate/index.html |ps2pdf - > Literature/praat_beginners_guide.pdf)&

# Nextens
./get_site $@ http://nextens.uvt.nl
./get_site $@ http://nextens.uvt.nl/download/distributions/download.html

# Festival
./get_site $@ http://festvox.org
./get_site $@ http://festvox.org/packed/
./get_site $@ --base='http://festvox.org/packed/' -F -i festvox.org/packed/index.html
./get_site $@ --base='http://festvox.org/packed/' -F -i festvox.org/packed/index.html
./get_site $@ http://festvox.org/packed/festival/
./get_site $@ --base='http://festvox.org/packed/festival/' -F -i festvox.org/packed/festival/index.html
./get_site $@ http://festvox.org/packed/festival/1.95/
./get_site $@ --base='http://festvox.org/packed/festival/1.95/' -F -i festvox.org/packed/festival/1.95/index.html

# Specific papers
./get_site $@ http://festvox.org/festtut/notes/festtut_toc.html
./get_site $@ http://festvox.org/bsv/book1.html
./get_site $@ http://festvox.org/docs/manual-1.4.3/festival_toc.html
./get_site $@ http://festvox.org/docs/manual-1.4.3/festival_toc.html
./get_site $@ http://www.cstr.ed.ac.uk/~simonk/em/em_synthesis.html

# Get the actual distribution
# cat festvox.org/packed/festival/1.95/index.html \
#   |perl -e 'while(<>){while(m!\<a\s+href\=[^\w]?(http://[\w\-/\+\.]+)[^\w\-/\+\.]?\s*\>!isg){$l=$1;print "./get_site $l&\n";};};'\
#   |sh

#Literature
./get_site $@ http://lands.let.kun.nl/cgn/home.htm
./get_site $@ http://www.ling.lu.se/research/speechtutorial/tutorial.html
./get_site $@ http://cslu.cse.ogi.edu/HLTsurvey/download.html
./get_site $@ http://ocw.mit.edu/NR/rdonlyres/Electrical-Engineering-and-Computer-Science/6-345Automatic-Speech-RecognitionSpring2003/

mkdir -p Literature
if [[ ! -s Literature/SprekenEnVerstaanHfdst14.pdf ]]; then
    wget -nc -nd -O SprekenEnVerstaanHfdst14.pdf http://blackboard.ic.uva.nl/courses/1/15.OWII.BAISHS6.1.04/content/_234319_1/hfdst14.pdf
fi

if [[ ! -s Literature/hieronymus_att_worldbet.pdf ]]; then
    wget -nc -nd -O Literature/hieronymus_att_worldbet.pdf http://www.ling.ohio-state.edu/~edwards/worldbet.pdf
fi

if [[ ! -s Literature/SPbpaper.pdf ]]; then
    wget -nc -nd -O Literature/SPbpaper.pdf http://blackboard.ic.uva.nl/courses/1/15.OWII.BAISHS6.1.04/content/_234323_1/SPbpaper.pdf
fi

if [[ ! -s Literature/Elsnet_in_Wonderland.pdf ]]; then
    wget -nc -nd -O Literature/Elsnet_in_Wonderland.pdf http://blackboard.ic.uva.nl/courses/1/15.OWII.BAISHS6.1.04/content/_234327_1/Elsnet_in_Wonderland.pdf
fi

if [[ ! -s Literature/OVIS.pdf ]]; then
    wget -nc -nd -O - http://lands.let.kun.nl/literature/strik.1996.4.ps | ps2pdf - >Literature/OVIS.pdf
fi

if [[ ! -s Literature/SpokenLanguageProcessingCh1.pdf ]]; then
    wget -nc -nd -O Literature/SpokenLanguageProcessingCh1.pdf http://vig.prenhall.com/samplechapter/0130226165.pdf
fi

if [[ ! -s Literature/HLTsurveyPDF/HLTsurveyCh13.pdf ]]; then
perl -e 'foreach $i (1..13){print "(html2ps cslu.cse.ogi.edu/HLTsurvey/ch${i}node[0-9].html ch${i}node[0-9][0-9].html|ps2pdf ->Literature/HLTsurveyPDF/HLTsurveyCh$i.pdf)\n";};'|sh
fi

if [[ ! -s Literature/IFALabelProtocol.pdf ]]; then
    wget -nc -nd -O Literature/IFALabelProtocol.pdf http://www.fon.hum.uva.nl/Service/IFAcorpus/SLcorpus/LabelProtocol/LabelProtocol.pdf
fi

if [[ ! -s Literature/IFALabelProtocol.pdf ]]; then
    wget -nc -nd -O Literature/Automatic-Speech-RecognitionSpring2003_lecture14.pdf http://ocw.mit.edu/NR/rdonlyres/Electrical-Engineering-and-Computer-Science/6-345Automatic-Speech-RecognitionSpring2003/71DB5BA6-5C29-45A7-A8AB-8841373120A9/0/lecture14.pdf 
fi

# IFA stuff
./get_site $@ http://www.fon.hum.uva.nl/Proceedings/IFA-Proceedings.html
./get_site $@ http://www.fon.hum.uva.nl/IFA-publications/Others/Other_papers.html

#
