Last change
on this file since 31289 was 31289, checked in by davidb, 7 years ago |
initial setup files for collection
|
-
Property svn:executable
set to
*
|
File size:
502 bytes
|
Line | |
---|
1 | #!/bin/bash
|
---|
2 |
|
---|
3 | ht_base_url="https://catalog.hathitrust.org/api/volumes/full/htid"
|
---|
4 |
|
---|
5 |
|
---|
6 | for mf in `find import/ -name "*.mets.xml"` ; do
|
---|
7 | d=${mf%/*}
|
---|
8 | f=${mf##*/}
|
---|
9 |
|
---|
10 | echo "Processing: $mf"
|
---|
11 | id=`fgrep 'PREMIS:objectIdentifierValue' "$mf" | sed 's/\s*<[^>]*>\s*//g'`
|
---|
12 | echo " id='$id'"
|
---|
13 |
|
---|
14 | jf=${mf%.mets.xml}.json
|
---|
15 | if [ ! -e "$jf" ] ; then
|
---|
16 | full_url="$ht_base_url/${id}.json"
|
---|
17 | echo "Downloading: $full_url"
|
---|
18 | echo " to $jf"
|
---|
19 | # wget -O "$jf" "$full_url"
|
---|
20 | curl "$full_url" > "$jf"
|
---|
21 | fi
|
---|
22 |
|
---|
23 | done
|
---|
Note:
See
TracBrowser
for help on using the repository browser.