Skip to content

Instantly share code, notes, and snippets.

View benwbrum's full-sized avatar

Ben W. Brumfield benwbrum

View GitHub Profile
@benwbrum
benwbrum / pbcore_to_iiif.rb
Created May 19, 2024 13:16
Sample script to convert a PBCore XML file into a IIIF manifest
require 'nokogiri'
class PBCoreToIIIF
def self.generate_manifest(xml_file)
# Read the PBCore XML file
xml = File.read(xml_file)
# Parse the XML using Nokogiri
doc = Nokogiri::XML(xml)
@benwbrum
benwbrum / alto_xml.xml
Created May 13, 2024 16:02
Example of alto file causing problems for the Annotorious text overlay
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<alto xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.loc.gov/standards/alto/ns-v4#" xmlns:page="http://schema.primaresearch.org/PAGE/gts/pagecontent/2013-07-15" xsi:schemaLocation="http://www.loc.gov/standards/alto/ns-v4# https://www.loc.gov/standards/alto/v4/alto.xsd">
<Description>
<MeasurementUnit>pixel</MeasurementUnit>
<sourceImageInformation>
<fileName>orig_proc-api-030d3cfc-9e7c-46b8-8a00-3acdacc3b0d1.jpg</fileName>
</sourceImageInformation>
<Processing ID="IdOcr">
<processingDateTime>2024-03-26T22:01:38.621+01:00</processingDateTime>
<processingSoftware>
{
"@context": "http://iiif.io/api/presentation/3/context.json",
"id": "https://iiif.io/api/cookbook/recipe/0269-embedded-or-referenced-annotations/annotationpage.json",
"type": "AnnotationPage",
"items": [
{
"id": "https://iiif.io/api/cookbook/recipe/0269-embedded-or-referenced-annotations/canvas-1/annopage-2/anno-1",
"type": "Annotation",
"motivation": "commenting",
"body": {
@benwbrum
benwbrum / ford_journal_manifest.json
Last active March 21, 2024 19:50
v3 manifest from Internet Archive including OCR as annotations
{
"@context":"http://iiif.io/api/presentation/3/context.json",
"id":"https://iiif.archive.org/iiif/journalofexpedit00ford/manifest.json",
"type":"Manifest",
"label":{
"none":[
"Journal of an expedition made in the autumn of 1794, with a detachment of New Jersey troops into western Pennsylvania to aid in suppressing the \"Whiskey rebellion.\""
]
},
"metadata":[
{
"@context":"http://iiif.io/api/presentation/3/context.json",
"requiredStatement":{
"label":{
"en":[
"Rights Note"
]
},
"value":{
"en":[
@benwbrum
benwbrum / spokenweb_atwood_notes.txt
Created December 1, 2023 15:36
Spokenweb notes stanza for Margaret Atwood
Margaret Atwood reads from You Are Happy (Oxford University Press, 1974) and Power Politics (Anansi, 1971). Atwood also answers audience questions about her work.
00:00- Unknown introducer makes an announcement about the room. [INDEX: Sir George Williams University, larger hall, gallery, Howard Fink.]
00:21- Howard Fink answers question.
00:22- Unknown introducer continues to make announcements. [INDEX: loud speakers outside, paintings, Fine Arts Department, artists, Howard Fink, air conditioning.]
01:22- Audience talking
01:30- Margaret Atwood talks about room set up, it is recorded by the mic [INDEX: room change.]
01:41- Audience responds, says they want to stay in the same room.
01:44- Margaret Atwood tries to arrange people in the room. [INDEX: chairs, bench, people, rows, room.]
04:41- Margaret Atwood continues to arrange audience.
@benwbrum
benwbrum / spokenweb_atwood_contents.txt
Created December 1, 2023 15:35
SpokenWeb contents stanza
margaret_atwood_i006-11-008.mp3
Henry Beissel
00:00:00
One moment... problem that we have here at Sir George [https://www.wikidata.org/wiki/Q326342]. We did try to get a larger hall but it was impossible. To accommodate the overflow, we have set up loudspeakers in the little gallery here, Howard, and in the other one too?
Howard Fink
00:00:21
Outside.
@benwbrum
benwbrum / fromthepage_manifest_with_inline_annotation_lists.json
Last active October 19, 2023 20:54
Inline annotation list experiment
{
"@context": "http://iiif.io/api/presentation/2/context.json",
"@id": "https://fromthepage.com/iiif/11/manifest",
"@type": "sc:Manifest",
"label": "George East to Thomas East",
"metadata": [
{
"label": "dc:source",
"value": "record 103-5"
},
@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":"",