Skip to content

Instantly share code, notes, and snippets.

@andrewgiessel
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewgiessel/11187054 to your computer and use it in GitHub Desktop.
Save andrewgiessel/11187054 to your computer and use it in GitHub Desktop.
bookmarklet to automatically proxify a page for harvard's library system
// most recent update: 04/22/2014
// one liner
javascript:function go(){var asdf = window.location.host.replace(/\./g, "-");window.location = window.location.protocol+'//'+asdf+'.ezp1.harvard.edu'+window.location.pathname+window.location.search;}go();void(0);
// expanded
function go() {
var asdf = window.location.host.replace(/\./g, "-"); // replace all the periods with dashes (uses regexp)
window.location = window.location.protocol+'//' +
asdf +
'.ezp1.harvard.edu' +
window.location.pathname +
window.location.search;
}
go();
void(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment