Skip to content

Instantly share code, notes, and snippets.

@comstock
comstock / curlLibraryCloud.md
Last active December 13, 2023 18:45
Using Harvard Library's LibraryCloud, send a MARC/MODS XML, Dublin Core XML, or MODS JSON version of an item record to standard output.

curl "https://api.lib.harvard.edu/v2/items.[xml | dc | json]?recordIdentifier=[Hollis ID]"

Example, Dublin Core output: curl "https://api.lib.harvard.edu/v2/items.dc?recordIdentifier=990058255550203941"

#!/usr/python3
import os
import csv
from ipwhois import IPWhois
# clean-up
try:
os.remove('.\\output\\Z39.50 Usage - IPs (last 3 months) -- enhanced.csv')
except FileNotFoundError:
pass