Skip to content

Instantly share code, notes, and snippets.

View benwbrum's full-sized avatar

Ben W. Brumfield benwbrum

View GitHub Profile
@benwbrum
benwbrum / ia_ocr_annotation_mockup_v2_list.json
Last active September 7, 2023 20:55
Mock-up of a v2 annotation list including OCR
{
"@context": [
"http://iiif.io/api/extension/text-granularity/context.json",
"http://iiif.io/api/presentation/2/context.json"
],
"@id": "https://iiif.archivelab.org/iiif/rbmsbk_ap2-v4_2001_V55N4$1/ocr",
"@type": "sc:AnnotationList",
"label": "OCR Text",
"resources": [
{
@benwbrum
benwbrum / ia_ocr_annotation_mockup_v2.json
Last active September 14, 2023 20:43
Mock-up of a v2 manifest containing OCR text as annotations
{
"@context": [
"https://iiif.io/api/presentation/2/context.json",
"https://iiif.io/api/extension/text-granularity/context.json"
],
"@id":"https://iiif.archivelab.org/iiif/bub_gb_j45FRJELCpkC/manifest.json",
"@type":"sc:Manifest",
"attribution":"The Internet Archive",
"cover":"https://iiif.archivelab.org/iiif/bub_gb_j45FRJELCpkC$0",
"description":"",
@benwbrum
benwbrum / collection.json
Created May 21, 2023 14:38
Helen Hartness Flanders Collection as a IIIF Collection Manifest
This file has been truncated, but you can view the full file.
{
"@context":"http://iiif.io/api/presentation/3/context.json",
"id":"\"https://iiif.archive.org/collection/helenharknessflanders/manifest.json",
"type":"Collection",
"label":{
"none":[
"Helen Hartness Flanders Ballad Collection"
]
},
"items":[
@benwbrum
benwbrum / metadata_to_exclude.py
Created May 19, 2023 21:14
Internet archive metadata fields which should be excluded from the metadata stanza of IIIF manifests. (Note that some should be used in other locations in the manifest)
metadata_to_exclude = [
'avg_rating', 'backup_location', 'btih', 'contributor', 'description', 'downloads',
'imagecount', 'indexflag', 'item_size', 'licenseurl'
'noindex', 'num_reviews', 'oai_updatedate', 'publicdate', 'publisher', 'reviewdate',
'scanningcentre', 'stripped_tags', 'uploader'
]
@benwbrum
benwbrum / ia_av_mockup_manifest.json
Last active May 6, 2023 21:26
Mock-up of a v3 manifest supporting AV for the Internet Archive
{
"@context":"http://iiif.io/api/presentation/3/context.json",
"id":" https://gist.githubusercontent.com/benwbrum/c669baaaafab349630faf4c5bbf9deed/raw/9a9b6eb126d4f49df49ea85416390dbd886eec01/ia_av_mockup_manifest.json",
"type":"Manifest",
"label":{
"none":[
"Cylinder 26 - Flanders Ballad Collection IRENE"
]
},
"homepage":[
@benwbrum
benwbrum / iiif_ocr_annotation_mockup_v2.js
Created March 13, 2023 12:32
Mockup of OCR Text as annotations on a IIIF v2 manifest
{
"@context":"http://iiif.io/api/presentation/2/context.json",
"@id":"https://iiif.archivelab.org/iiif/wg35-2-388/manifest.json",
"@type":"sc:Manifest",
"attribution":"The Internet Archive",
"description":"[18--]: Ballads | 19th century | Judgement Day | Death | Religion",
"label":"Can newydd sef myfyrdod ar farwolaeth, ac er anogaeth i bawb ystyried eu diwedd : Cenir ar y dôn Fechan, [gan] Richard Williams a'i cânt",
"logo":"https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcReMN4l9cgu_qb1OwflFeyfHcjp8aUfVNSJ9ynk2IfuHwW1I4mDSw",
"metadata":[
{
@benwbrum
benwbrum / tool_dating_links.md
Last active April 17, 2025 14:54
Useful links for "Tool Dating" at DigEdTnT Workshop
@benwbrum
benwbrum / mastodon_directory.rb
Created December 21, 2022 21:45
Script to read the public profile directory from one or more mastodon servers and produce a spreadsheet with account descriptions and names
#!/usr/bin/env ruby
require 'open-uri'
require 'pry'
require 'json'
f = File.open("accounts.csv", "w+")
f.print ['username','display name', 'account', 'created', 'posts', 'followers', 'following', 'note'].join("\t")
f.print "\n"
{"@context":"http://iiif.io/api/presentation/3/context.json","@id":"https://weareavp.aviaryplatform.com/iiif/q814m9208v/manifest","@type":"Manifest","label":{"en":["This Is A VTT Example for BL"]},"metadata":[{"label":{"en":["Duration"]},"value":{"en":["00:00:47"]}},{"label":{"en":["Publisher"]},"value":{"en":["AVP"]}},{"label":{"en":["Agent"]},"value":{"en":["Bertram Lyons (Speaker)"]}},{"label":{"en":["Date"]},"value":{"en":["2021-01-25 (Created)"]}},{"label":{"en":["Language"]},"value":{"en":["English (Primary)"]}}],"provider":[{"id":"https://weareavp.aviaryplatform.com/aboutus","type":"Agent","label":{"en":["AVP"]},"homepage":[{"id":"https://weareavp.aviaryplatform.com/","type":"Text","label":{"en":["AVP"]},"format":"text/html"}],"logo":{"@id":"https://d2hx64tshfdz71.cloudfront.net/organizations/logo_images/000/000/007/original/AVP_logo.png?1549563699"}}],"thumbnail":[{"id":"https://d2hx64tshfdz71.cloudfront.net/public/images/audio-default.png","type":"Image","format":"image/png"}],"items":[{"id":"https:/
@benwbrum
benwbrum / ia_to_iiif_collection.rb
Created December 9, 2020 16:25
Internet Archive collection to IIIF collection manifest script
#!/usr/bin/env ruby
require 'oai'
require 'pry'
require 'json'
collection = ARGV.first
manifest = {
"@context" => "http://iiif.io/api/presentation/2/context.json",