From 33d4bb587ab5992f37dc0df4baf02e5a2b4fe4e3 Mon Sep 17 00:00:00 2001 From: Adrian Short Date: Thu, 12 Jan 2017 16:37:58 +0000 Subject: [PATCH] Added descriptive/verbose output; save URLs to local file --- get.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/get.sh b/get.sh index 21be6b1..f027f42 100755 --- a/get.sh +++ b/get.sh @@ -8,19 +8,28 @@ # Adrian Short 26 Feb 2016 COOKIEJAR=cookiejar.txt -BASEURL=https://fastweb.sutton.gov.uk/fastweb +URLS=urls.txt +BASEURL=https://fastweb.sutton.gov.uk/FASTWEB mkdir -p $1 cd $1 +echo "Getting session cookies" curl -s -c $COOKIEJAR "$BASEURL/welcome.asp" > /dev/null # Get the session cookies +echo "OK" +echo +echo "Getting list of PDF files. This could take several minutes if there are a large number of documents for this application." curl -s -c $COOKIEJAR \ --data "cbxCopyrightStatement=on" \ --data "ApplicationNumber=$1" \ "$BASEURL/images.asp" \ - | grep -E -o 'http.+?\.(pdf|PDF)' \ - | wget --no-check-certificate --no-clobber -i - + | grep -E -o 'http.+?\.(pdf|PDF)' > $URLS +echo "OK" + +echo "Downloading PDFs" +wget --no-check-certificate --no-clobber -i $URLS +echo "Downloading complete" rm $COOKIEJAR ls -lht