Add KCLS links to Goodreads

Puts links in Goodreads lists that go directly to a search at the King County Library System

  1. // ==UserScript==
  2. // @name Add KCLS links to Goodreads
  3. // @namespace http://use.i.E.your.homepage/
  4. // @version 1.02
  5. // @description Puts links in Goodreads lists that go directly to a search at the King County Library System
  6. // @match http*://www.goodreads.com/review/list/*
  7. // @copyright 2014, Shayne Holmes
  8. // @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
  9. // @require https://greasyfork.org/scripts/2199-waitforkeyelements/code/waitForKeyElements.js?version=6349
  10. // @author Shayne Holmes
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. this.$ = this.jQuery = jQuery.noConflict(true);
  15.  
  16. $("th.title").after(function(){ return $(this).clone().removeClass('title').addClass('kcls').html('<div style="margin: auto 10px;">kcls</div>');});
  17.  
  18. waitForKeyElements ("td.field.title", addkclslinks);
  19.  
  20. function addkclslinks(jNode) { jNode.after(
  21. function(){ return $(this).clone().removeClass('title').addClass('kcls')
  22. .html("<div style='margin: auto 10px;'><a title='search on KCLS' href=http://kcls.bibliocommons.com/search?t=smart&search_category=keyword&q="
  23. + encodeURIComponent(this.innerText)
  24. + "&commit=Search>kcls</a></div></td>");}
  25. ); }
  26.