Skip to content

Instantly share code, notes, and snippets.

View ruthtillman's full-sized avatar

Ruth ruthtillman

View GitHub Profile
@ruthtillman
ruthtillman / doi-response-rdf-xml.xml
Created January 16, 2019 13:36
Response received for `curl "Accept: application/rdf+xml" http://doi.org/10.1080/15332748.2017.1400725`
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:j.0="http://purl.org/dc/terms/"
xmlns:j.1="http://prismstandard.org/namespaces/basic/2.1/"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:j.2="http://purl.org/ontology/bibo/"
xmlns:j.3="http://xmlns.com/foaf/0.1/">
<rdf:Description rdf:about="http://dx.doi.org/10.1080/15332748.2017.1400725">
<j.1:endingPage>36</j.1:endingPage>
<j.0:publisher>Informa UK Limited</j.0:publisher>
@ruthtillman
ruthtillman / metadata-analysis-notes.md
Created October 26, 2017 18:22
Notes from metadata analysis workshop

Gretchen's tool: XMLStarlet

@ruthtillman
ruthtillman / as_family_accession.sql
Created September 25, 2017 15:49
Gets records which have family names as agents and returns those. It looks like sometimes it may return the record twice, perhaps if two agents?
SELECT
accession.identifier,
accession.title,
accession.create_time,
accession.accession_date,
accession.general_note,
date.expression,
date.begin,
date.end,
@ruthtillman
ruthtillman / as_corporate_accession.sql
Created September 25, 2017 14:55
Gets records which have corporate entity names agents and returns those. It looks like sometimes it may return the record twice, perhaps if two agents?
SELECT
accession.identifier,
accession.title,
accession.create_time,
accession.accession_date,
accession.general_note,
date.expression,
date.begin,
date.end,
@ruthtillman
ruthtillman / as_person_accession.sql
Created September 25, 2017 14:52
Gets records which have person names as agents and returns those. It looks like sometimes it may return the record twice, perhaps if two agents?
SELECT
accession.identifier,
accession.title,
accession.create_time,
accession.accession_date,
accession.general_note,
date.expression,
date.begin,
date.end,
@ruthtillman
ruthtillman / as_agent_accessions.sql
Last active September 25, 2017 14:50
ArchivesSpace Query With All Agent IDs or Nulls As Columns
SELECT
accession.identifier,
accession.title,
accession.create_time,
accession.accession_date,
accession.general_note,
date.expression,
date.begin,
date.end,
@ruthtillman
ruthtillman / addMissingEditors.py
Created August 1, 2017 14:01
A gist to detect whether the group of records has an editor key, if the editor key exists, if the editor key doesn't exist for that particular group we add it (because this should have one), and adds this editor if we have nothing.
import glob, json
files = glob.glob("*.jsonld")
for fileName in files:
with open(fileName, "r") as record:
recorddata = json.loads(record.read())
if recorddata.has_key("hydra:hasEditorGroup"):
if recorddata[u"hydra:hasEditorGroup"] == {u'@id': u'und:[redacted]'}:
print 'true'
else:
@ruthtillman
ruthtillman / waybacksubmit.py
Last active February 10, 2021 19:26
A python script which allows one to send a set of URLs as a Python list to the Internet Archive. Prints a results file to let you know how it did. Sleeps 0.5 seconds between sending
#! /usr/bin/env python
# With gratitude to W. Caleb McDaniel and based on https://gist.github.com/wcaleb/218d210687546c8efd0a
import requests, datetime, time
from datetime import date
def backupURLS(urls):
today = date.today()
results = str(today) + '-results.txt'
@ruthtillman
ruthtillman / resilience.md
Last active April 27, 2017 20:08
My response to the ACRL survey on resilience

I have survived in a public library when hiring freezes lost us two full-time and one-part time person, where we were piling books on the floor of our back room and eventually resorted to volunteer labor (to be very clear here, we were asking people to do unpaid labor in place of what had been two full-time and one half-time jobs, two full-time and one half-time jobs which no longer existed for people in our community to support themselves and their families, two full-time and one half-time jobs for which skilled and aspiring library paraprofessionals could apply and in which they could gain experience). This could be seen as resilience but this was failure to our workers, our community, and our potential employees.

I have worked at an under-funded, under-siege library as a contractor, where I had to be resilient in the face of administration and other loud voices who forced librarians to defend every decision. I have been forbidden to weed duplicate copies of books which haven't been off the shelf, let alon

@ruthtillman
ruthtillman / find-files.sh
Created December 8, 2016 17:14
Using a list.
#!/bin/bash
for file in 9780268075606_EPUB.epub 9780268075552_EPUB.epub 9780268086961_EPUB.epub 9780268076610_EPUB.epub 9780268077884_EPUB.epub 9780268087678_EPUB.epub 9780268089894_EPUB.epub 9780268086978_EPUB.epub 9780268092962_EPUB.epub 9780268085575_EPUB.epub 9780268081782_EPUB.epub 9780268079789_EPUB.epub 9780268077037_EPUB.epub 9780268074814_EPUB.epub 9780268074807_EPUB.epub 9780268074821_EPUB.epub 9780268074883_EPUB.epub 9780268077044_EPUB.epub 9780268158866_EPUB.epub 9780268087661_EPUB.epub 9780268158057_EPUB.epub 9780268091835_EPUB.epub 9780268077013_EPUB.epub 9780268086923_EPUB.epub 9780268074678_EPUB.epub 9780268093020_EPUB.epub 9780268077914_EPUB.epub 9780268096540_EPUB.epub 9780268086701_EPUB.epub 9780268076801_EPUB.epub 9780268084523_EPUB.epub 9780268077921_EPUB.epub 9780268077686_EPUB.epub
do
if [ -f "$file" ]
then
echo "$file found."
else
echo "$file not found."
fi
done