Skip to content

Instantly share code, notes, and snippets.

Josh Weisman jweisman

Block or report user

Report or block jweisman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:15bfa5094ea463d6c4c0
var timer;
var feedbackOn = false;
var isInitial = true;
var cookieName = "feedback";
function showFeedback() {
if (!feedbackOn) {
$("#shorttext").css("display", "none");
jweisman / harvest.rb
Last active Sep 3, 2015
Harvest OAI to AWS CloudSearch
View harvest.rb
require 'rest-client'
require 'nokogiri'
require 'aws-sdk-core'
def process_oai(inst, qs, domain, alma)
oai_base = "https://#{alma}{inst}/request"
log "Calling OAI with query string #{qs}"
oai = RestClient.get oai_base + qs
jweisman /
Last active Nov 1, 2016
Shell script to add a file to an Alma Digital representation
FILENAME=`basename "$1"`
if [ $# -lt 2 ]; then
echo "Usage: `basename $0` file-name representation-id [file-label]"
exit 0
jweisman / index.js
Created Dec 17, 2016
Twitter Card Proxy
View index.js
'use strict';
exports.handler = function(event, context) {
var agent = event.headers['User-Agent'] || 'None';
var path = event.path.substring(event.path.indexOf('http'));
if (agent.startsWith('Twitterbot')) {
var proxy = require('./proxy');
proxy(path, (err, status, headers, body) => {
var response = {
jweisman / curl.txt
Last active Feb 9, 2017
Alma SWORD Deposits
View curl.txt
Content-Type: application/atom+xml; charset="utf-8"
Content-Disposition: attachment; name=atom
MIME-Version: 1.0
<?xml version="1.0"?>
<entry xmlns=""
<title>Deposit sample</title>
jweisman /
Last active Oct 18, 2017
Process Orchestration in Alma with the Job and Set APIs
echo "Creating new set"
SET_ID=`curl -s --fail -X POST -H "Authorization: apikey $API_KEY" -H "Content-type: application/xml" -H "Accept: application/xml" --data @set.xml "" | xmllint --xpath '/set/id/text()' -`
if test $res != 0; then
echo "HTTP request failed with return code $res"
exit $res
jweisman / workflow.json
Last active Apr 17, 2018
Azure Logic App for Alma Webhooks
View workflow.json
"$connections": {
"value": {
"sftp": {
"connectionId": "/subscriptions/78e1da39-3d31-4b09-8636-f49b6fc5223b/resourceGroups/DefaultResourceGroup/providers/Microsoft.Web/connections/sftp-1",
"connectionName": "sftp-1",
"id": "/subscriptions/78e1da39-3d31-4b09-8636-f49b6fc5223b/providers/Microsoft.Web/locations/eastus/managedApis/sftp"
jweisman / Program.cs
Last active May 1, 2018
Refit for Alma APIs
View Program.cs
using Newtonsoft.Json;
using Refit;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace refitalma
[Headers("Accept: application/json")]
public interface IAlmaApi
jweisman / AlmaValidateFields.groovy
Last active Oct 5, 2018
Script to validate the existence of several custom fields on transition using the ScriptRunner plugin for Jira.
View AlmaValidateFields.groovy
import com.opensymphony.workflow.InvalidInputException
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
def customFieldManager = ComponentManager.getInstance().getCustomFieldManager()
def fields = []
// For Alma issues, if issue is fixed, make all sorts of validations
jweisman / parallel.js
Last active Jan 16, 2019
Ex Libris Alma - Parallel API Calls
View parallel.js
const { PerformanceObserver, performance } = require('perf_hooks');
const alma = require('almarestapi-lib');
const records = 10000;
const limit = 25;
const url = '/users?view=brief';
const arrayName = 'user';
var offset = 0, total = 0, processed = 0;
You can’t perform that action at this time.