#!/bin/bash # Ripping Metrotime Belgium set -x # 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 # 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}'` PDF="http://www.metrotime.be/UserFiles/${PDF}" wget -q -P $TMP $PDF done #Making of one bih PDF file #gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$TMP/finished.pdf `ls $TMP/*.pdf` nice joinPDF $TMP/finished.pdf `ls $TMP/*.pdf` > /dev/null 2>&1 #Added for silcence mv $TMP/finished.pdf ~/metro_`date +%Y%m%d`.pdf acroread ~/metro_`date +%Y%m%d`.pdf & exit 0