Created
April 30, 2020 12:47
-
-
Save dannylamb/2f51722514a699a71fc60f041a838764 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
set -euxo pipefail | |
COLLECTION_NID=`curl -sSf -X POST -u changeme:changeme -H "Content-Type: application/json" -d "{\"title\": [\"Christian Martyrdom\"], \"type\": \"islandora_object\", \"field_model\": [30]}" http://future.islandora.ca/entity/node?_format=json | jq -re '.nid[0].value'` | |
for file in *.jpg; do | |
PAGE_NID=`curl -sSf -X POST -u changeme:changeme -H "Content-Type: application/json" -d "{\"title\": [\"$file\"], \"type\": \"islandora_object\", \"field_member_of\": [$COLLECTION_NID], \"field_model\": [31]}" http://future.islandora.ca/entity/node?_format=json | jq -re '.nid[0].value'` | |
curl -sSf -X PUT -u changeme:changeme -H "Content-Type: image/jpeg" -H "Content-Location: fedora://2020-04/$file" --data-binary @"$file" "http://future.islandora.ca/node/$PAGE_NID/media/image/16" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment