From 710ff20cdb4fd435f95e0f0fd6cacb8838aaf3c9 Mon Sep 17 00:00:00 2001 From: Nick White Date: Wed, 8 May 2019 13:11:36 +0100 Subject: Add scrape-erara.sh script (not fully tested) --- scrape-erara.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 scrape-erara.sh diff --git a/scrape-erara.sh b/scrape-erara.sh new file mode 100644 index 0000000..11754d6 --- /dev/null +++ b/scrape-erara.sh @@ -0,0 +1,43 @@ +#!/bin/sh +usage="Usage: $0 eraraurl + +eraraurl: The book index page, e.g. + https://www.e-rara.ch/zut/doi/10.3931/e-rara-10416 + +Downloads all pages from a book on e-rara.com, saving them to the +current directory. " + +test $# -ne 1 && echo "$usage" && exit 1 + +bookindex=`curl -s -f "$1"` +if test $? -ne 0; then + echo "Error downloading book index page: $1" + exit 1 +fi + +iiifpath=`echo "$bookindex" | sed 's/ "${pgname}.jpg" + if test $? -ne 0; then + echo "Error downloading page $i: $pgurl" + rm -f "${pgname}.jpg" + fi +done -- cgit v1.2.1-24-ge1ad