Skip to content

Instantly share code, notes, and snippets.

@mems
mems / gist:5169578
Created March 15, 2013 12:33
Function to handle binayr string to write short, long, and array of shorts and longs
<?php
/**
* Decode a binary string (2 bytes only) to a short
* @param $input binary string to decode
* @return short decoded
*/
function str2short($data)
{
//*<- add or remove "/" to toggle comment
@mems
mems / gist:4739515
Last active April 30, 2018 22:32
Download full size image from OLCL's CONTENTdm http://www.contentdm.org/

Example here : http://cdm16038.contentdm.oclc.org/cdm/compoundobject/collection/p15017coll23/id/1842 (from list : http://cdm16038.contentdm.oclc.org/cdm/landingpage/collection/p15017coll23 Hagley Digital Archives)

Execute on each image page, the following JS:

prompt("copy this metalink file data:",'<file name="'+$.trim($("#metadata_object_title").text())+'">\n<resources>\n<url type="http">'+server_api_url + "?CISOROOT=" + thisCollection + "&CISOPTR=" + thisItemId + "&action=2&DMSCALE=100&DMWIDTH="+thisImageInfo.imageinfo.width  +"&DMHEIGHT="+thisImageInfo.imageinfo.height+"&DMX=0&DMY=0&DMTEXT=&DMROTATE=0"+'</url>\n</resources>\n</file>');

Into metalink: