Difference between revisions of "Library"
(Created bookmarklet for searching the MLVC library) |
|||
(15 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | Suppose you're shopping on Amazon for a book like Lawrence Lessig's '''Free Culture: How Big Media Uses Technology and the Law to Lock Down Culture and Control Creativity''', and you wonder if your local library has a copy of the book. Amazon displays the ISBN near the title. The catalog for the Merrimack Valley Library Consortium supports lookup by ISBN. If you perform the search, you'll notice that the resulting URL for that search is | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | Suppose you're shopping on Amazon for a book like Lawrence Lessig's ''' | ||
− | |||
− | |||
− | |||
− | The catalog for the | ||
<pre> | <pre> | ||
http://newburyport.mvlc.org/eg/opac/record/888792?contains=contains;_special=1;qtype=identifier%7Cisbn;query=978-1594200069;locg=1 | http://newburyport.mvlc.org/eg/opac/record/888792?contains=contains;_special=1;qtype=identifier%7Cisbn;query=978-1594200069;locg=1 | ||
Line 19: | Line 8: | ||
<source lang=JavaScript> | <source lang=JavaScript> | ||
javascript: (function () { | javascript: (function () { | ||
− | |||
var t = window.getSelection ? window.getSelection().toString() : document.selection.createRange().text; | var t = window.getSelection ? window.getSelection().toString() : document.selection.createRange().text; | ||
− | + | window.location = 'http://newburyport.mvlc.org/eg/opac/results?contains=contains;_special=1;qtype=identifier%7Cisbn;query=' + t; | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
})() | })() | ||
</source> | </source> | ||
− | + | For the bookmarklet to work, it all has to be on one line. The code above is presented on several lines for readability. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Want this bookmarklet? Drag this link to your browser bookmark bar: <html><a href="javascript: (function(){var t=window.getSelection?window.getSelection().toString():document.selection.createRange().text;window.location='http://newburyport.mvlc.org/eg/opac/results?contains=contains;_special=1;qtype=identifier%7Cisbn;query='+t;})()">Search MLVC</a></html> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:Library]] | [[Category:Library]] |
Revision as of 15:40, 23 July 2014
Suppose you're shopping on Amazon for a book like Lawrence Lessig's Free Culture: How Big Media Uses Technology and the Law to Lock Down Culture and Control Creativity, and you wonder if your local library has a copy of the book. Amazon displays the ISBN near the title. The catalog for the Merrimack Valley Library Consortium supports lookup by ISBN. If you perform the search, you'll notice that the resulting URL for that search is
http://newburyport.mvlc.org/eg/opac/record/888792?contains=contains;_special=1;qtype=identifier%7Cisbn;query=978-1594200069;locg=1
Making this generic, you can change the string record/888792 to results and put any ISBN after the query= part and get the lookup results immediately. Taking it a step further, you can create a JavaScript bookmarklet that can be saved to your browser linkbar which allows you to simply highlight the ISBN on any webpage and instantly search your local library for the book. This is what the JavaScript code looks like:
javascript: (function () {
var t = window.getSelection ? window.getSelection().toString() : document.selection.createRange().text;
window.location = 'http://newburyport.mvlc.org/eg/opac/results?contains=contains;_special=1;qtype=identifier%7Cisbn;query=' + t;
})()
For the bookmarklet to work, it all has to be on one line. The code above is presented on several lines for readability.
Want this bookmarklet? Drag this link to your browser bookmark bar: Search MLVC