Created
January 26, 2018 04:24
-
-
Save wragge/d90421183730d0b3e89d1bad4d4f4ffc to your computer and use it in GitHub Desktop.
Userscript to change url of searches in SLNSW Pictures & Manuscripts catalogue to something easily shareable.
This file contains 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
// ==UserScript== | |
// @name SLNSW Manuscripts Catalogue Search Links | |
// @namespace http://timsherratt.org/slnsw-ms-catalogue-links | |
// @version 0.1 | |
// @description Change url of searches in MS catalogue to something shareable | |
// @author Tim Sherratt (@wragge) | |
// @match http://archival.sl.nsw.gov.au/results | |
// @grant GM_xmlhttpRequest | |
// @connect archival.sl.nsw.gov.au | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
GM_xmlhttpRequest({ | |
method: 'GET', | |
url: 'http://archival.sl.nsw.gov.au/history', | |
onload: function(response) { | |
var page = response.responseText; | |
var links = page.match(/(search\/simple\/repeat?.*?)"/g); | |
var link = links.pop(); | |
window.history.pushState({}, '', 'http://archival.sl.nsw.gov.au/' + link); | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Install Tampermonkey in your browser. Then click on the 'Raw' button above. You'll be asked to confirm that you want to install this script.
Try a search in the Manuscripts, Oral History and Pictures catalogue. The script replaces the url in your browser's location bar with one that you can copy, save or share.