Created
May 19, 2015 20:15
-
-
Save tingletech/06e81e93cc2aea8e58e1 to your computer and use it in GitHub Desktop.
scripts to harvest a collection out of Merritt
This file contains hidden or 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
<xsl:stylesheet | |
version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:atom="http://www.w3.org/2005/Atom" | |
xmlns:dct="http://purl.org/dc/terms/" | |
xmlns:str="http://exslt.org/strings" | |
xmlns:xlink="http://www.w3.org/1999/xlink"> | |
<!-- xslt for | |
one-off | |
--> | |
<xsl:output method="text"/> | |
<xsl:param name="base"/> | |
<xsl:template match="atom:feed"> | |
<xsl:apply-templates select="atom:entry"/> | |
</xsl:template> | |
<xsl:template match="atom:entry"> | |
<xsl:variable name="lid" select="str:replace(atom:id,'http://n2t.net/ark:/28722/','')"/> | |
<xsl:text>curl -u $MERRITT https://merritt.cdlib.org</xsl:text> | |
<xsl:value-of select="atom:link[@title='producer/mets.txt']/@href"/> | |
<xsl:text> > </xsl:text> | |
<xsl:value-of select="$lid"/><xsl:text>.mets.xml | |
</xsl:text> | |
<xsl:text>curl -u $MERRITT https://merritt.cdlib.org</xsl:text> | |
<xsl:value-of select="atom:link[@title='producer/FID1.tiff']/@href"/> | |
<xsl:text> > </xsl:text> | |
<xsl:value-of select="$lid"/><xsl:text>.tiff | |
</xsl:text> | |
</xsl:template> | |
</xsl:stylesheet> |
This file contains hidden or 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/env bash | |
set -eu | |
for i in $(seq 1 40) | |
do | |
curl -u $MERRITT "https://merritt.cdlib.org/object/recent.atom?collection=ark:/13030/m5xk8jh0&page=$i" > atom$i.xml | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment