Skip to content

Instantly share code, notes, and snippets.

{
"catalog": [
{
"manifestId": "https://iiif.archivelab.org/iiif/manualonmethodso00robe/manifest.json"
},
{
"manifestId": "https://pbinkley.github.io/rcb-manual/iiif/manualonmethodso00robe/manifest.json"
}
],
"companionWindows": {
pbinkley@Hoffnung:~/Projects/iiif/annonatate/annonatate-sourcecode-pbinkley (debug)
$ python annonatate/flaskserver.py
b05940aac8848aa8d00f
* Serving Flask app "flaskserver" (lazy loading)
* Environment: development
* Debug mode: on
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with inotify reloader
b05940aac8848aa8d00f
* Debugger is active!
$ python annonatate/flaskserver.py
b05940aac8848aa8d00f
* Serving Flask app "flaskserver" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with inotify reloader
b05940aac8848aa8d00f
@pbinkley
pbinkley / youtube-comments.json
Created May 6, 2021 17:58
Youtube comments demo sitemap for webscraper.io
{
"_id": "youtube-comments",
"startUrl": [
"https://www.youtube.com/watch?v=DLctAw4JZXE"
],
"selectors": [
{
"id": "comment",
"type": "SelectorElement",
"parentSelectors": [
@pbinkley
pbinkley / mirador.md
Created May 5, 2021 04:03
Mirador demo page for Wax sites
title layout
Mirador
default

{% assign iiif_collections = site.collections | where_exp: "coll", "coll['images']['source']" %} {% assign default_collection = iiif_collections[0]['label'] %} {% assign default_item = site.data[default_collection][0]['pid'] %}

@pbinkley
pbinkley / index.html
Last active June 3, 2021 15:30
Self-contained html file for showing OpenSeadragon view of a IIIF image
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/png" href="/images/logo16.png">
<title>IIIF Tile Source | OpenSeadragon</title>
<link rel='stylesheet'
@pbinkley
pbinkley / LICENSE.txt
Last active February 25, 2021 01:13 — forked from mejackreed/LICENSE.txt
Leaflet-IIIF Basic Example
MIT License
Copyright (c) 2016 Jack Reed
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@pbinkley
pbinkley / capturing-a-jekyll-site-as-a-warc.md
Last active March 2, 2021 00:46
Capturing a Jekyll site as a WARC

This is a method to capture the whole site, including files that are addressed only by javascript, such as the IIIF image tiles generated by Wax.

  • Install warcit and Webrecorder Desktop
  • Be sure the url and baseurl are configured correctly for your public site in Jekyll's _config.yml
  • Run bundle exec jekyll build to build the site in the _site directory
  • In the Jekyll main directory, run warcit <url><baseurl> ./_site/ (substituting the values for your site). This will produce a file called _site.warc.gz
  • Start Webrecorder Desktop and import the WARC file. Visit a random page and navigate the site.

Note that Webrecorder doesn't seem to give you an easy way to find the main index.html among all the harvested files.

@pbinkley
pbinkley / omeka-s-item-media.rb
Created September 3, 2020 15:27
Omeka-S REST API: minimal working example of creating an item with uploaded image in Ruby
=begin
This is a working example of the use of the Omeka-S REST API to create an item
with an associated image. It assumes you've set the API endpoint (e.g.
http://localhost:8080/api) and the authentication keys as environment
variables.
Note that the o:media element is an array, and can contain multiple images
(with sequential 'file_index' values, which must match the 'file[x]' element
in the payload).
@pbinkley
pbinkley / Dockerfile
Created August 28, 2020 19:39
Dockerfile for Pixplot 0.0.94
# Specify base image
FROM ubuntu:20.04
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN apt-get install -y python3-pip
# fix dependency versions
RUN pip3 install 'scipy==1.4.1'