Last active
December 20, 2015 13:19
-
-
Save ssp/6138027 to your computer and use it in GitHub Desktop.
Daten für Liste von PPNs runterladen und Daten extahieren
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/sh | |
# | |
# für wenige Datensätze: | |
# | |
# als JSON laden | |
cat ppns-hitliste.text | xargs -L 1 -I PPN /Users/ssp/Developer/sru-loader/sru-loader.py --url http://sru.gbv.de/opac-de-7 --schema picaxml --format json --folderdepth 0 --xsl /Users/ssp/SUB/bin/XSLT/Remove-Namespaces.xsl --xsl /Users/ssp/SUB/bin/XSLT/MarcXML2TurboMarc.xsl 'pica.ppn=PPN*' | |
# in CouchDB ablegen | |
find json -print0 | sed -e 's/json\///g' -e 's/\.json//g' | xargs -0 -L 1 -I FILE curl --netrc -X PUT -H "Content-Type: application/json" -d @json/FILE.json http://vlib.sub.uni-goettingen.de/couch/antje-favoriten/FILE | |
# | |
# für viele Datensätze | |
# | |
# als JSON laden in hierarchische Ordnerstruktur | |
cat ppns-hitliste.text | xargs -L 1 -I PPN /Users/ssp/Developer/sru-loader/sru-loader.py --url http://sru.gbv.de/opac-de-7 --schema picaxml --format json --folderdepth 1 --xsl /Users/ssp/SUB/bin/XSLT/Remove-Namespaces.xsl --xsl /Users/ssp/SUB/bin/XSLT/MarcXML2TurboMarc.xsl 'pica.ppn=PPN*' | |
# in CouchDB ablegen | |
ls -1 |xargs -L 1 -I FOLDER sh -c 'cd FOLDER; find . -print0 | sed -e "s/\.\///g" -e "s/\.json//g" | xargs -0 -L 1 -I FILE curl --netrc -X PUT -H "Content-Type: application/json" -d @FILE.json http://localhost:5984/antje-favoriten-2013-10-25/FILE' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment