Skip to content

Instantly share code, notes, and snippets.

@mikesname
mikesname / scopecontent.py
Last active September 22, 2016 16:44
Fetch id, name, and scope-content data for documentary units # and write as tab-separated values.
#!/usr/bin/env python3
# Fetch id, name, and scope-content data for documentary units
# and write as tab-separated values.
import sys, requests, csv, urllib
if len(sys.argv) < 1:
sys.stderr.write("usage: scopecontent.py <initial-api-url>\n")
sys.exit(1)
@mikesname
mikesname / history.py
Last active November 7, 2017 13:33
An example for fetching data from the EHRI GraphQL API and converting it to TSV
#!/usr/bin/env python3
# Fetch id, name, and scope-content data for documentary units
# and write as tab-separated values.
import sys, requests, csv, json
if len(sys.argv) < 1:
sys.stderr.write("usage: history.py <initial-api-url>\n")
sys.exit(1)
@mikesname
mikesname / repository-names.gql
Last active November 1, 2016 16:15
GraphQL query for retrieving repository id and names from the EHRI GraphQL API
query exampleQuery($cursor: Cursor) {
repositories(after: $cursor) {
items {
id
description {
name
}
}
pageInfo {
nextPage
@mikesname
mikesname / data-from-graphql.py
Last active May 5, 2020 19:38
Processing data from GraphQL to CSV. Install the ijson module first.
#!/usr/bin/env python3
import csv, ijson, sys
items = ijson.items(sys.stdin, "data.documentaryUnits.items.item")
csvout = csv.writer(sys.stdout, quoting = csv.QUOTE_MINIMAL)
for item in items:
for description in item["descriptions"]:
row = [
@mikesname
mikesname / osticket.md
Last active August 2, 2021 10:59
OSTicket no thread displayed...

OSTicket Duplicate email debugging

Problem:

  • Threads not being show when opening ticket
  • No JS or other apparent UI errors

Error in Apache logs: