Quickly find books at library

Here's a script you can use in Firefox to see if a book is at your local library.

When I come across an interesting book review or recommendation from a friend, I go straight to Amazon, read a little about it, and if I'm still interested I add it to my wish list . Then when I need some books to read, I go through and see if any on my list are already at the local library. About every three months I buy 5-10 of the one's that aren't at the library.

I was looking for an easier way to do my library lookup today. On Twitter, milsyobtaf suggested a Firefox bookmarklet, and after playing around with it I decided to just write a quick script for Ubiquity to do the lookup ( Ubiquity is a very cool text-based add-on to firefox).  In case anyone else is interested, here's how you do it:

  1. Install Ubiquity if you don't already have it.
  2. Open Ubiquity (not sure what the default command is, I have mine set to Alt + Space) and type help.
  3. Click "Your Commands" at the top
  4. Copy/paste this code in there:
    CmdUtils.CreateCommand({
    name: "library search",
    takes: {"query": noun_arb_text},
    execute: function(directObject) {
    var url = "https://libcat.tamu.edu/cgi-bin/Pwebrecon.cgi?&HIST=1&DB=local&SL=none&Search_Arg={QUERY}&Search_Code=GKEY^*&CNT=50"
    var query = directObject.text;
    var urlString = url.replace("{QUERY}", query);
    Utils.openUrlInBrowser(urlString);
    }
    })
  5. Go to your local library's website, find the catalog search, do a search for something, and then copy the url of the results page. Paste the url above where it says var url = " ... "
  6. In the url, change whatever you searched for to {QUERY}. For example, if I searched for Vonnegut, the above url would have in it ...Search_Arg=Vonnegut&... . This is the part that will get replaced when you do a search.

That's it! Now open Ubiquity (Alt + Space on my computer), start typing "library", once you see your library search option press space then type your search, hit Enter and it should do a library search for you.

Another way to search Ubiquity is to select text, then open ubiquity and start typing "library." It will use your selected text as the search query. So, on this page highlight Kurt Vonnegut, then open Ubiquity, type library, and press Enter.

---

If you have a book recommendation, please leave them as a comment or email me .

No comments yet