Skip to content

Instantly share code, notes, and snippets.

@zuphilip
zuphilip / check-consistency-book-chapters.js
Created July 11, 2020 12:12
JS-Script for Zotero to check consistency for your book chapters in your library
/*
Check data consistency for book chapters of the same book
(isbn check for that). For each outputed object the bookTitle,
publisher and place should be the same also when there are more
than one chapter in your currently selected library. If not, then
you may want to look closer to this reported incosistency. [License: CC0]
*/
var isbnData = {};
@zuphilip
zuphilip / gnd-wikidata-csv-10000.csv
Last active June 11, 2020 13:11
Ausgewertete Wikipediaseite zu https://de.wikipedia.org/wiki/Benutzer:Zuphilip/Analyse_zu_Normdaten (Daten können frei unter CC0 nachgenutzt werden)
We can't make this file beautiful and searchable because it's too large.
title,GND dewiki,touched,Wikidata,GND ID,isequal
Alan_Smithee,123396956,20200115232040,Q734916,123396956,true
Actinium,4523163-1,20200603125602,Q1121,4523163-1,true
Ang_Lee,119317079,20200206150717,Q160726,119317079,true
Aussagenlogik,4136098-9,20200218214948,Q200694,4136098-9,true
Anthony_Minghella,120882965,20200512173730,Q188726,120882965,true
Alfred_Hitchcock,118551647,20200506133739,Q7374,118551647,true
Aki_Kaurismäki,118972332,20200416000343,Q276186,118972332,true
Actionfilm,4140847-0,20200213161542,Q188473,4140847-0,true
Al_Pacino,119070243,20200509071348,Q41163,119070243,true
@zuphilip
zuphilip / Dockerfile
Last active July 24, 2020 11:07
Test to run a RMarkdown in Binder
## Use a tag instead of "latest" for reproducibility
FROM rocker/binder:latest
## Declares build arguments
ARG NB_USER
ARG NB_UID
## Copies your repo files into the Docker Container, install needed LaTeX packages
USER root
RUN apt-get update && apt-get install -y --no-install-recommends xsltproc texlive-lang-german
@zuphilip
zuphilip / test.html
Last active April 16, 2020 15:22
test
SOCIAL SCIENCES 378-378
; j > apis ye 37801 pedagogy, research and institutional life for rstcentury /'edited by Margaret Benefiel, Shalem Spiritual Formation, Bo Karen Lee, Princeton al Seminary. Charlotte, NC: Information Age Pub- „ 1910 pages cm. (Advances in workplace spiritu- ality: theory, research and application) = Inclūdes bibliographical- references: [LB2322 2.568 2019] 23 2019-018968 ISBN 1-64113-697-9 price'unreported 1. Education, Higher — Aims and objectives. 2. Education, Higher — Religious aspects. 3. Universities and colleges — Religion. I. Benefiel, Margaret, Il. Lee, Bo Karen, 1971- III. Series.
GUMPORT, Patricia J., 378.050973 Academic fault lines: the rise of industry logic in public higher education / Patricia J. Gumport. Baltimore: Johns Hopkins University Press, [2019] xvi, 526 pages; 24 cm Con- tents:Points of departure — Conceptual and empirical an- chors: studying institutional change — Built to serve — level expectations — Forces converging to advance in- dustry logic — Beyond
@zuphilip
zuphilip / isbn-lookup.js
Last active April 12, 2020 10:09
Update metadata by ISBN lookup from LoC
// can be run within Zotero "Run Javascript" tool
var overwrite = true;
var skip = ["key", "dateAdded"];
var updated = [];
var items = Zotero.getActiveZoteroPane().getSelectedItems();
let translate = new Zotero.Translate["Search"]();
// LoC ISBN translator:
translate.setTranslator("c070e5a2-4bfd-44bb-9b3c-4be20c50d0d9");
@zuphilip
zuphilip / converted.hocr
Last active January 3, 2020 06:28
Example from hocr-to-alto
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Image: </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="ocr-system" content="ABBYY FineReader Engine 12"/>
<meta name="ocr-capabilities" content="ocr_page ocr_par ocr_line ocrx_word"/>
</head>
@zuphilip
zuphilip / zotero-wikidata-lookup.js
Last active December 16, 2021 10:52
Zotero Script for Wikidata Lookup
// Zotero script look up selected items in Wikidata and
// check whether the DOI can be found there. If results
// are found then the QIDs are saved in the corresponding
// items in the extra field. Some warnings are given for the
// other cases; thus you may want to watch the Zotero error
// console as well during execution of the script. [CC0]
var items = Zotero.getActiveZoteroPane().getSelectedItems();
var map = [];
@zuphilip
zuphilip / zotero-find-allupercase-title.js
Created December 26, 2019 20:43
Find in currently selected Zotero collection the items with all-upercase title
var collection = ZoteroPane.getSelectedCollection();
var items = collection.getChildItems();
var returnItems = [];
for (let item of items) {
let title = item.getField("title");
if (title.toUpperCase() == title) {
returnItems.push(title);
}
}
return returnItems;
@zuphilip
zuphilip / zotero-author-lobid-lookup.js
Last active December 26, 2019 20:39
Zotero author lookup in lobid API and enhance with GND ids
// WHAT: for each selected item, go through all creators and look each of them up in lobid GND API
// if any differentiated persons are found, then update this information about possible
// GND machtes in the extra field (proof-of-concept)
// HOW: can be run within Zotero "Run Javascript" tool
var items = Zotero.getActiveZoteroPane().getSelectedItems();
var apiCall = "https://lobid.org/gnd/search?q=";
var suffix = "&filter=type:DifferentiatedPerson&format=json";
for (let item of items) {
@zuphilip
zuphilip / field-report.js
Last active December 15, 2019 19:31
JS-Script for a report about the values of a simple field over all items of the currently selected collection in Zotero or your whole Zotero library
/*
Change the constant 'field' to any simple Zotero field
(see https://api.zotero.org/itemFields?pprint=1 for a list)
and run the script as async funtion to see a report
of the currently selected collection or your complete
library. [License: CC0]
*/
const field = "language";
var collection = ZoteroPane.getSelectedCollection();