#v+ #!/bin/bash ################################################# # Script to retrieve metro online in pdf format # # repo@geginnerslinux.org # # http://beginnerslinux.org # ################################################# # Parameters STARTPAGE="http://www.metrotime.be/digipapernl.html?pag=" SP="&kdate=" TMP=/tmp/metro NUMBER=1 NEXT=YES #Making the directory and cleaning stuff up test -d $TMP && rm $TMP -rf test -d $TMP || mkdir -p $TMP cd /tmp/metro # Getting the individual pages while [ "$NEXT" = "YES" ] do PAGE=${STARTPAGE}${NUMBER}${SP} wget -q -O $TMP/metrotime $PAGE TEST=`grep "next" $TMP/metrotime` if [ "$TEST" = "" ] then NEXT=NO fi let NUMBER=NUMBER+1 PDF=`grep pdf /tmp/metro/metrotime|awk -F UserFiles '{print $NF}'|awk -F\" '{print $1}'` PDR= wget "http://www.metrotime.be/UserFiles${PDF}" $PDR done #Making 1 PDF file of all the little ones gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$TMP/finished.pdf `ls $TMP/*.pdf` mv $TMP/finished.pdf ~/metro_`date +%Y%m%d`.pdf #joinPDF $TMP/finished.pdf `ls $TMP/*.pdf` > /dev/null 2>&1