Using Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C

18
Using Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C Annette Bailey University Libraries Virginia Tech April 29, 2008

description

Using Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C. Annette Bailey University Libraries Virginia Tech April 29, 2008. Part 2. Google Book Classes. Mashing a Service into the III Catalog Display. MAJAX mashes catalog data into other web pages - PowerPoint PPT Presentation

Transcript of Using Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C

Page 1: Using  Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C

Using Google Book Classes in Mashups

Excerpt from talk given at IUG 2008 in Washington,

D.C

Annette BaileyUniversity Libraries Virginia Tech

April 29, 2008

Page 2: Using  Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C

Part 2

Google Book Classes

Page 3: Using  Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C

Mashing a Service into the III Catalog Display

• MAJAX mashes catalog data into other web pages

• Now we’ll mash data from another service into the library catalog

Page 4: Using  Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C

Google Book Search Book Viewability API

• Programmatic client-side access to small set of Google Book Search information• Provides thumbnails of book covers• Provides link to Google’s book

information, preview, or full text pages• Provides information on whether Google

has full text, partial preview, or no preview

• Indexed by ISBN#, OCLC#, LCCN#• Released March 2008

Page 5: Using  Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C

Goals

• We want to incorporate information from Google Book Search into our catalog• E.g., allow users to see a preview of

a book if one is available from Google

• Or use Google’s book covers• Without JavaScript coding• (even though Google’s API requires

JavaScript coding as it is)

Page 6: Using  Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C

Google Book Classes

Demo

Page 7: Using  Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C

Google Books Demo

Buttons appear if Google Book Search has a partial preview of book

Page 8: Using  Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C

Google Books Demo (2)

Buttons appears if Google has a partial preview of book

Page 9: Using  Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C

Google Book Classes

• A JavaScript library and set of classes that simplify using the Google Book Search Book Viewability API• Can be used on any web page,

including inside the Millennium system

• Usage is much like MAJAX• Available from libx.org/gbs

Page 10: Using  Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C

Using Google Book Classes(on general web server)• Upload a copy of gbsclasses.js to your server• Include gbsclasses.js in a <script> tag in the

target page

• Include the class(es) in <span> tags

<script type="text/javascript" src="http://yourserver/yourpath/gbsclasses.js"></script>

<script type="text/javascript" src="http://yourserver/yourpath/gbsclasses.js"></script>

<span title=“ISBN:0596002556” class=“gbs-thumbnail”></span>

<span title=“ISBN:0596002556” class=“gbs-thumbnail”></span>

Page 11: Using  Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C

GBS Identifiers• <span title=“IDENTIFIER”

class=“GBS-CLASSES”></span>

• IDENTIFIER can refer to ISBN #, OCLC #, or LCCN#

• Alternate syntax: use * as IDENTIFIER

ISBN ISBN:006073132X

OCLC OCLC:57207630

LCCN LCCN:2004022563

Page 12: Using  Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C

Using Google Book Classes in Millennium1. Include gbsclasses.js in HTML

template file via <script> tag• E.g. toplogo.html

2. Use III fieldspec token to insert HTML that includes the Google Book Classes into the briefcit.html file

Page 13: Using  Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C

briefcit.html

briefCitPub <div>

Page 14: Using  Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C

A Google Preview Button

<div class="briefCitPub"><table><tr><td style="text-align:left" width="65%"><!--{fieldspec:Vbp260}--></td><td width="35%"><span style="display:none" title="*" class="gbs-link-to-info gbs-if-partial gbs-remove-on-failure"><!--{fieldspec:Vbi020}--> <img src="http://code.google.com/apis/books/images/api-example2.png"></span></td></tr></table></div>

<div class="briefCitPub"><table><tr><td style="text-align:left" width="65%"><!--{fieldspec:Vbp260}--></td><td width="35%"><span style="display:none" title="*" class="gbs-link-to-info gbs-if-partial gbs-remove-on-failure"><!--{fieldspec:Vbi020}--> <img src="http://code.google.com/apis/books/images/api-example2.png"></span></td></tr></table></div>

Inside “Publisher” box

Insert 1x2 HTML table

260 Field goes in left column

hide span initially Link to info page – but only ifGoogle has a partial view

Remove span if Google does not index this ISBN

III will put first 020 Field here

briefcit.html

Page 15: Using  Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C

Currently Supported Google Book Classes• Thumbnails Image

• gbs-thumbnail• Wrap span in a hyperlink

• gbs-link-to-preview• gbs-link-to-info• gbs-link-to-thumbnail

• Conditionals: only keep span if …• gbs-if-noview• gbs-if-partial-or-full• gbs-if-partial• gbs-if-full

• Remove if Google does not index book• gbs-remove-on-failure

• Multiple classes can be combined

Page 16: Using  Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C

Google Book Classes: Summary

• Google Book Classes allows the use of the Google Book Viewability API in mashups• Without requiring any

JavaScript or AJAX knowledge• Allows integration in places

(such as III briefcit.html) where control of a page is limited

Page 17: Using  Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C

Acknowledgements

• Dr. Godmar Back• Assistant Professor

Computer Science

Page 18: Using  Google Book Classes in Mashups Excerpt from talk given at IUG 2008 in Washington, D.C

Questions?

Thank you!

http://libx.org/gbs

Contact us:

[email protected]