Skip to content

Instantly share code, notes, and snippets.

View stitchinthyme's full-sized avatar

stitchinthyme

View GitHub Profile
@stitchinthyme
stitchinthyme / get_oai_free_science_sites.py
Last active August 29, 2015 14:19
Script to query OpenDoar for science sites in English that allow free access to their metadata; parses the XML into JSON
import urllib2
import xml.etree.ElementTree as etree
import json
# Query for sites in English that have science data, an OAI URL, and allow free access to metadata.
resp = urllib2.urlopen('http://opendoar.org/api13.php?la=en&oai=y&pograde=11,12&subject=Ca,Ce,Cur,Cuv')
data = resp.read()
tree = etree.fromstring(data)
l = []
for child in tree.iter('repository'):