Demo for Google Book Classes

Google Book Classes wraps the Google Book Viewability API in a set of easy-to-use HTML widgets to merge information from Google Books into a webpage. Use "View Source" to examine the simple HTML tags that have created the content you see below.

The Google Book Classes (gbs) are available under the LGPL license. If you deploy it, please host gbsclasses.js on your own machine.

For users of the III Millennium OPAC, these slides describe how to integrate GBS into your OPAC.

Examples:

<span title="ISBN:0061234001" class="gbs-thumbnail"></span>
<span title="ISBN:0596000278" class="gbs-thumbnail gbs-link-to-preview"></span>
<span style="display:none" title="ISBN:0596000278" 
   class="gbs-link-to-info gbs-if-partial gbs-remove-on-failure">
  <img src="http://code.google.com/apis/books/images/api-example2.png">
</span>
Alternate syntax. Use '*' in title and place identifier in span.
<span title="*" class="gbs-thumbnail gbs-link-to-info">
OCLC:60348769
</span>
<span title="*" class="gbs-thumbnail-large gbs-remove-on-failure">
1412908892 (cloth)</span>
OCLC:60348769 1412908892 (cloth)
Alternate syntax 2. Use 'OCLC:*' in title and place OCLC number in span.
<span title="OCLC:*" class="gbs-thumbnail gbs-link-to-info">
60348769
</span>
60348769
Alternate syntax 2a. Use 'OCLC:*' in title and place OCLC number in span. OCLC number may contain a "ocm" prefix.
<span title="OCLC:*" class="gbs-thumbnail-large gbs-link-to-info">
ocm60348769
</span>

ocm60348769

See this page for more tests.

Supported Classes

gbs-thumbnail Include an <img...> embedding the thumbnail image

gbs-thumbnail-large Like gbs-thumbnail, except larger. This option is experimental and not supported by Google.

gbs-link-to-preview Wrap span in link to preview at GBS

gbs-link-to-info Wrap span in link to info page at GBS

gbs-link-to-thumbnail Wrap span in link to thumbnail at GBS

gbs-if-noview Keep this span only if GBS reports that book's viewability is 'noview'

gbs-if-partial-or-full Keep this span only if GBS reports that book's viewability is at least 'partial'

gbs-if-partial Keep this span only if GBS reports that book's viewability is 'partial'

gbs-if-full Keep this span only if GBS reports that book's viewability is 'full'

gbs-remove-on-failure Remove this span if GBS doesn't return bookInfo for this item

Note: Google appears to have a relatively large numbers of ISBNs misindexed. I am suspecting that in general, OCLC# or LCCN# may be better identifiers to use.

Example 1: ISBN:1402038682 (misindexed)   OCLC:63180607 (correct)   LCCN:2006436815 (correct)  

Example 2: ISBN:1402030533 (misindexed)   OCLC:60679740(correct)   LCCN:2005275561 (correct)