Skip to content

Instantly share code, notes, and snippets.

@tclancy
Last active December 15, 2015 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tclancy/5247584 to your computer and use it in GitHub Desktop.
Save tclancy/5247584 to your computer and use it in GitHub Desktop.
Search Dover, NH Library by Title from Goodreads Detail Page
javascript:window.open("http://librarycatalog.dover.nh.gov/cgi-bin/koha/opac-search.pl?idx=&q="+encodeURIComponent(document.getElementById("bookTitle").innerText.replace(/\([^\)]+\)/, '').replace(/^\s\s*/, '').replace(/\s\s*$/, '')));
@tclancy
Copy link
Author

tclancy commented Mar 26, 2013

Copy the content (starting with "javascript:") and make a bookmark in your browser. If you click the bookmark while looking at a Goodread's page for a book, it will search the Dover, NH library catalog by title for the full name.

More about bookmarklets: http://en.wikipedia.org/wiki/Bookmarklet

@tclancy
Copy link
Author

tclancy commented Mar 27, 2013

TODO

  • [ X] trim whitespace from value with regex
  • open second window for books by this author (what to do with multiple authors?)

@tclancy
Copy link
Author

tclancy commented Mar 27, 2013

@tclancy
Copy link
Author

tclancy commented Mar 27, 2013

First crack at the author version:

javascript:window.open("http://librarycatalog.dover.nh.gov/ipac20/ipac.jsp?index=.AW&term="+encodeURIComponent(document.getElementsByClassName("authorName")[0].innerText.replace(/\([^\)]+\)/, '').replace(/^\s\s_/, '').replace(/\s\s_$/, '')));

@tclancy
Copy link
Author

tclancy commented Oct 6, 2013

Updated for new Dover library site.

@tclancy
Copy link
Author

tclancy commented Oct 6, 2013

Author search:

javascript:window.open("http://librarycatalog.dover.nh.gov/cgi-bin/koha/opac-search.pl?idx=au%2Cwrdl&q="+encodeURIComponent(document.getElementsByClassName("authorName")[0].innerText.replace(/\([^\)]+\)/, '').replace(/^\s\s_/, '').replace(/\s\s_$/, ''))+"&op=and&idx=kw&q=&op=and&idx=kw&do=Search");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment