Skip to content

Instantly share code, notes, and snippets.

View rubinsztajn's full-sized avatar

Aaron Rubinstein rubinsztajn

  • UMass Amherst
  • Amherst, MA
View GitHub Profile
@rubinsztajn
rubinsztajn / snac-rdfa.rdf
Created April 13, 2011 17:20
RDFa snippet for sameAs rels in SNAC
<!-- RDFa snippet example for SNAC -->
<div xmlns:owl="http://www.w3.org/2002/07/owl#">
<div about="http://socialarchive.iath.virginia.edu/xtf/view?docId=Eisenhower+Dwight+D+Dwight+David+1890-1969-cr.xml#entity">
<div>sameAs</div>
<a rel="owl:sameAs" href="http://viaf.org/viaf/100176316">http://viaf.org/viaf/100176316</a>
</div>
</div>
import csv
import rdflib
from rdflib.graph import Graph
from rdflib import plugin
out = csv.writer(open('databib.csv', 'w'))
out.writerow(['Name','Page','License','Deposit'])
plugin.register(
'sparql', rdflib.query.Processor,
@rubinsztajn
rubinsztajn / gist:3948790
Created October 24, 2012 20:49
For class...
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="marmota.xsl" type="text/xsl"?>
<!DOCTYPE ead PUBLIC "+//ISBN 1-931666-00-8//DTD ead.dtd (Encoded Archival Description (EAD) Version 2002)//EN" "ead.dtd">
<ead>
<eadheader langencoding="iso639-2b" countryencoding="iso3166-1" dateencoding="iso8601" repositoryencoding="iso15511" scriptencoding="iso15924" audience="internal" id="head" relatedencoding="MARC21">
<eadid publicid="-//us::mu//TEXT us::mu::mums129.xml//EN" countrycode="us" mainagencycode="mu">mums129</eadid>
<filedesc>
<titlestmt>
@rubinsztajn
rubinsztajn / binder_fire
Created December 13, 2012 16:01
Binder fire
if binders:
Burn 'em...
test:
if binders.ash?:
log = "Thank fucking god"
@rubinsztajn
rubinsztajn / ia_download.py
Last active December 21, 2015 00:58
Simple script to download MARCXML and PDFs from the internet archive
#!/usr/bin/env python
import os, sys
ids = open(sys.argv[1])
for id in ids:
id = id.strip()
pdf_cmd = "wget http://archive.org/download/%s/%s.pdf" % (id, id)
marc_cmd = "wget http://archive.org/download/%s/%s_archive_marc.xml" % (id, id)