Last active
December 15, 2015 10:39
-
-
Save tclancy/5247584 to your computer and use it in GitHub Desktop.
Search Dover, NH Library by Title from Goodreads Detail Page
This file contains hidden or 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
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*$/, ''))); |
TODO
- [ X] trim whitespace from value with regex
- open second window for books by this author (what to do with multiple authors?)
Example of a problem author list: http://www.goodreads.com/book/show/12095.The_Bald_Soprano_and_Other_Plays
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_$/, '')));
Updated for new Dover library site.
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
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