Skip to content

Instantly share code, notes, and snippets.

View jsicot's full-sized avatar

Julien Sicot jsicot

View GitHub Profile
@jsicot
jsicot / 360.xsl
Created June 8, 2015 16:35
360.xsl
<xsl:template name="tag_010">
<xsl:param name="tag"/>
<xsl:param name="label"/>
<xsl:if test="marc:datafield[@tag=$tag]/marc:subfield[@code='a']">
<tr valign="top">
<th><xsl:value-of select="$label"/> : </th><td>
<xsl:for-each select="marc:datafield[@tag=$tag]">
<xsl:call-template name="addClassRtl"/>
<xsl:for-each select="marc:subfield[@code='a']">
@jsicot
jsicot / retrieve_author_ppn.py
Created October 16, 2018 18:46
Retrieve author PPN
import csv
import urllib.request,urllib.parse,json
import os, ssl
# SSL exception
if (not os.environ.get('PYTHONHTTPSVERIFY', '') and
getattr(ssl, '_create_unverified_context', None)):
ssl._create_default_https_context = ssl._create_unverified_context
def getPpn(name,firstname,birthdate):
@jsicot
jsicot / custom.js
Created May 15, 2020 13:00
intégration istex dans primo
(function() {
"use strict";
'use strict';
var app = angular.module('viewCustom', ['angularLoad']);
app.config(['$sceDelegateProvider', function($sceDelegateProvider) {
var urlWhitelist = $sceDelegateProvider.resourceUrlWhitelist();
urlWhitelist.push('https://api.istex.fr/document/openurl**');
@jsicot
jsicot / bookmarklet primo R2
Last active September 30, 2021 14:42
bookmarklet primo R2 pour faire apparaitre des liens vers notices sources (pnx, unimarc, sru, oai, etc)
javascript:(function() { var showPnxLinkElem = document.querySelectorAll('prm-brief-result-container'), urlParamVid = location.search.split('vid=')[1].split('&')[0]; function createLink (linkUrl, linkText) { var obj = document.createElement("a"); obj.setAttribute("href", linkUrl); obj.setAttribute("target", "_blank"); obj.style.margin = "0 0 0 2em"; obj.innerHTML = linkText; return obj; } for (var i=0, j=showPnxLinkElem.length; i < j; i++) { var showPnxRecId = showPnxLinkElem[i].querySelector('.list-item-primary-content').getAttribute('data-recordid'), resultItemChildren = showPnxLinkElem[i].parentNode.childNodes, resultItemLastChild = resultItemChildren[resultItemChildren.length-1], recordIdSpan = document.createElement("span"), hrefBase = showPnxLinkElem[i].querySelector('.media-thumbnail').querySelector('a').getAttribute('ng-href').replace(/docid=.*?(&|$)/, "docid="+showPnxRecId+"$1"), bn = showPnxRecId.replace(/33UDR2_KOHA/, ""), showIntranetLinkHref = "https://pro-koha.bu.univ-rennes2.fr/cgi-bin/koha/cat