This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype><html><head> | |
<meta charset="utf-8"> | |
<title>Import slides from external md file</title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" href="http://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/themes/css/cartodb.css"> | |
<link rel="stylesheet" href="http://cartodb.github.io/odyssey.js/editor/css/slides.css"> | |
<script type="text/javascript" src="//cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pywikibot | |
import pywikibot.data.wikidataquery as wdquery | |
import json | |
import codecs | |
BAD = json.load(codecs.open('fixLinks.json', 'r', 'utf-8')) | |
PATTERN = '2048005/Athena_Plus_ProvidedCHO_Nationalmuseum__Sweden__Inv__Nr__' | |
# add string replace for server change | |
BAD['//emp-web-22.zetcom.ch/eMuseumPlus?'] = \ | |
'//collection.nationalmuseum.se/eMuseumPlus?' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: UTF-8 -*- | |
# | |
# Test for redux equivalency | |
# run from main directory | |
# | |
import codecs | |
import random | |
files = ('ausstellung_trim.csv', 'ereignis_trim.csv', 'objMass_trim.csv', | |
'photo_multimedia_etc.csv', 'kuenstler_trim.csv', 'objDaten_etc.csv', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import pywikibot | |
import pywikibot.data.wikidataquery as wdquery | |
COLLECTION_P = '195' | |
PART_P = '518' | |
INSTITUTION_Q = '842858' | |
PREFIX_MAP = { | |
u'NM': {u'subcol': None, u'place': u'Q%s' % INSTITUTION_Q}, | |
u'NMB': {u'subcol': None, u'place': u'Q%s' % INSTITUTION_Q}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# | |
# Cleanup function for a one-time replacement of upper case connections | |
# in Materials, Keywords and ObjKeywords | |
# | |
import helpers | |
import codecs | |
import os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# python check_WLE_id.py -live -dir:~/Projects/batchUploadTools/ | |
"""Script for updating unused imges/unknonw ids pages for WLE on sv.wp.""" | |
import pywikibot | |
import wikidataStuff.wdqsLookup as query | |
SETTING = { | |
'prop': 'P3613', | |
'formatter_url': 'http://skyddadnatur.naturvardsverket.se/sknat/?nvrid={}', | |
'cat': 'Category:Protected areas of Sweden with known IDs', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Backup copy at https://gist.github.com/lokal-profil/31d8651049d1ebf58bc668c7f27ab288 | |
var rangeRef = "Staff!G1" // this is the cell in which the allowed personnel range (on the same sheet) is specified. | |
var delimiterLookup = { | |
"COMMA": ",", | |
"SEMICOLON": ";", | |
"PERIOD": ".", | |
"SPACE": " " | |
} | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
""" | |
Quick pywikibot wrapper for statement addition. | |
""" | |
import pywikibot | |
PROP = 'P5008' | |
TARGET_Q = 'Q123' | |
REF_PROP = 'P248' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Script to make a local copy of the last complete log | |
# make a local copy of the logs | |
cp /data/project/heritage/logs/update_monuments.log ./raw.log; | |
# cut log at last complete | |
last_complete=$(grep --binary-files=text -n "Done with the update!" raw.log | tail -n1 | cut -f1 -d:); | |
head -n "$last_complete" raw.log > tmp.log; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import argparse | |
import re | |
def clean_log(filename): | |
import codecs | |
f_in = codecs.open(filename, 'r', 'utf-8') | |
f_out = codecs.open('{}.clean'.format(filename), 'w', 'utf-8') | |
bad_warnings = ( |
OlderNewer