58
Creating Library Web Services: Mashups and APIs Karen A. Coombs [email protected]

Library Mashups & APIs

Embed Size (px)

Citation preview

Page 1: Library Mashups & APIs

Creating Library Web Services:

Mashups and APIsKaren A. Coombs

[email protected]

Page 2: Library Mashups & APIs

About Me

• ~ 10 Years library web stuff

• Self taught coder who loves to play

• Work with developers regularly

Page 3: Library Mashups & APIs

About You

• Name

• Institution

• Techie skills

• HTML, Javascript, DOM, XML, Server side scripting (PHP, ASP, Rails, Coldfusion...)

• What you want to learn today

Page 4: Library Mashups & APIs

What Is A Mashup?

• a Web application that uses and/or combines data from multiple sources within a single tool

Page 5: Library Mashups & APIs

Why Create A Mashup

• Want to bring together disparate data sources

• Want to enhance a existing source of data

• Want to improve usability and user interfaces

• Want to make a web page more dynamic and engaging

Page 6: Library Mashups & APIs

Some Library Mashups

• LibraryFind

• Repository 66

• Scriblio

• Terrapod Project

• Texas A&M Geologic Atlas of the US

• VuFind implementations

• WorldCat Search plugin for FCKEditor

Page 7: Library Mashups & APIs
Page 8: Library Mashups & APIs
Page 9: Library Mashups & APIs
Page 10: Library Mashups & APIs
Page 11: Library Mashups & APIs
Page 12: Library Mashups & APIs
Page 13: Library Mashups & APIs
Page 14: Library Mashups & APIs
Page 15: Library Mashups & APIs
Page 16: Library Mashups & APIs
Page 17: Library Mashups & APIs

Mashups Don’t have to Be Read Only

• Web Services can be capable of read/write

• A mashup could write data as part of its functionality

• Examples

• Flickr Manager plugin for Wordpress

• Kaltura plugin for Wordpress

Page 18: Library Mashups & APIs
Page 19: Library Mashups & APIs
Page 20: Library Mashups & APIs

How Do Mashups Work?

• Take existing data within a system

• Retrieve data from another source(s) typically via a web service

• Mix these datasets together for UI purposes

Page 21: Library Mashups & APIs

Technologies Behind the scenes

• Web Services (REST, SOAP, XML-RPC)

• Some server side or client side scripting language

• Data formated in XML or JSON

Page 22: Library Mashups & APIs

What are Web Services?

• Machine readable data or procedures access via HTTP

• On a remote/external system (usually)

• Use structured data for data exchange (often XML)

• Come in 3 flavors : RPC, SOAP, REST

Page 23: Library Mashups & APIs

REST Primer

• Easiest web service style

• Readable by Humans

• Most popular form of web services today

• Create, Read, Update Delete

• POST, GET, PUT, DELETE

Page 24: Library Mashups & APIs

What is JSON?

• Javascript Object Notation

• Text file used to pass information from one system to another

• Javascript treats it as an object

• which makes it easily navigated and specific pieces cherry-picked

Page 25: Library Mashups & APIs

ProcessGBSBookInfo({ "ISBN0765304368":{ "bib_key":"ISBN0765304368", "info_url":"http://books.google.com/books?id=gfg13CM_kU8C&source=gbs_ViewAPI", "preview_url":"http://books.google.com/books?id=gfg13CM_kU8C&printsec=frontcover&sig=jIrSb_SkcQRhy_VvtnKbTXjmvos&source=gbs_ViewAPI", "thumbnail_url":"http://books.google.com/books?id=gfg13CM_kU8C&pg=PP1&img=1&zoom=5&sig=LsTwGVAsy_qWYMPM6HVDTPAMokg", "preview":"full" } });

Page 26: Library Mashups & APIs

XML Data Manipulation

• XPath

• Little bit like the DOM but more complex and smart

• Allows you to cherry pick info in XML documents

• Learn more about XPath - http://www.w3schools.com/xpath

Page 27: Library Mashups & APIs

XML XPATH EXAMPLE

• Want to get the feed name

• Want to get the item title, description, and url

Page 28: Library Mashups & APIs

The XPath

• Feed Title - /feed/title

• Item title - //entry/title or /feed/entry/title

• Item Content - //entry/content

• Item Url - //entry/link@href

Page 29: Library Mashups & APIs

Cross Server ScriptingIssues

• AJAX doesn’t allow you to access “scripts” across servers

• XML, PHP or other scripting languages

• Can access JSON across servers

• Reason why JSON popular

• Workaround

Page 30: Library Mashups & APIs

Cross Server ScriptingWorkarounds

• Proxy the script via the webserver

• Apache mod_proxy

• Use an intermediary to transform content into JSON

• Use PHP to convert XML to JSON

Page 31: Library Mashups & APIs

Possible Types Of Data

• Bibliographic Data

• Book Covers

• Digital Library metadata and objects

• Reviews

• Ratings

• Library Information

• Map Data

Page 32: Library Mashups & APIs

Data Sources For Mashups

• Feeds from library catalog, Amazon or other sources

• Covers, Ratings and Reviews from LibraryThing

• ISBNdb.com

• Preview or fulltext from GoogleBooks

• Info from Wikipedia

• Data from Talis platform

• Data from Open Library

Page 33: Library Mashups & APIs

Other Library Vendor Web Services

• Serial Solutions - http://journal.code4lib.org/articles/108

• SFX

• Gold Rush Link Resolver - http://grx.coalliance.org/grxtest/dsp/grx_documentation.pdf

• Lots of library database platforms

• Several library catalogs

Page 34: Library Mashups & APIs

OCLC Web Services for Mashups

• WorldCat Search API

• WorldCat Identities

• xID services

• xISBN

• xISSN

• xOCLCNum

• Registry Search

• Registry Detail

Page 35: Library Mashups & APIs

WorldCat Search API

• Search WorldCat in a programmatic fashion

• OpenSearch, SRU

• Get data back as XML

• Atom, RSS, MARCXML, Dublin Core

Page 36: Library Mashups & APIs

xID Service

• Service for identifiers

• OCLC number, ISSN, ISBN

• Send an identifier

• Get related identifiers back

• Get information about item

• Peer Reviewed or not

• RSS for Table of Contents

Page 37: Library Mashups & APIs

Worldcat Registry

• Data about libraries throughout the world

• Name

• Address

• Catalog url

• Type (public, academic, special ...)

Page 38: Library Mashups & APIs

Serial Solutions API

• OpenURL based

• Send an OpenURL

• Get back holdings information

• Uses

• Crosslisting ebooks

• Direct Links to Fulltext in LibraryFind

Page 39: Library Mashups & APIs

Serial Solutions APIResponse

• Citation

• Holdings Info

• Provider - Proquest

• Database Name - Safari Tech Books

• Start & End Dates

• URL(s)

Page 40: Library Mashups & APIs

Serial Solution Response URLs

• Different types of URLs

• Depends on OpenURL sent

• format

• granularity

• Books - source, book

• Journal - source, article, journal, volume, issue

Page 41: Library Mashups & APIs

Crosslisting Ebooks

Page 42: Library Mashups & APIs

Direct Links to Fulltext in LibraryFind

Page 43: Library Mashups & APIs

Other APIs We’re Using

• Google Calendar API - http://code.google.com/apis/calendar/data/2.0/developers_guide.html

• Google Maps - http://code.google.com/apis/maps/

• Last.fm - http://www.last.fm.api• Wikipedia API - http://

en.wikipedia.org/w/api.php

Page 46: Library Mashups & APIs
Page 47: Library Mashups & APIs

The Simplest Mashups

• Feeds

• The poor man’s web services

• XML

• Can have schemas added to them

• Feed2JS

• embed a feed in a web page

• Drupal and Wordpress can have feeds embedded into pages

Page 48: Library Mashups & APIs
Page 50: Library Mashups & APIs

Why Use Pipes?

• Programming for non-programmers

• Good user community

• Clone!!

• End up with a variety of formats

• Widgets

• RSS

• JSON

• PHP

Page 51: Library Mashups & APIs

Feed Remix with Pipes

• Find several feed you want to mix together

• Get their feed urls

• Filter if you want

• New Feed output

Page 52: Library Mashups & APIs

WorldCat Search + Book Covers

• RSS + Cover Data + Yahoo Pipes

• ISBN essential

• How does it work?

• RSS feed from WorldCat Search API

• Extracts ISBN

• Gets cover data

• Builds new feed with covers

Page 53: Library Mashups & APIs

WorldCat Registry+ Yahoo Maps

• Send registry request for data for a particular location (zip code, city)

• Retrieve results

• Send address information to Yahoo Maps

• Get library locations plotted on map

Page 54: Library Mashups & APIs

WorldCat Holdings+ Yahoo Maps

• Send an OCLC number and location to WorldCat Search API

• Returns a list of libraries nearest that location with holdings (includes address)

• Send libraries’ address to Yahoo Maps

• See which libraries in that location have that book visualized

Page 55: Library Mashups & APIs

Crosslisting ContentIn the Catalog

• Serial Solutions OpenURL Resolver

• API

• WorldCat Search API

• ISBN/ISSN

• Adds also available as link to ebook print book

Page 56: Library Mashups & APIs

Four Code Walkthroughs

• Google Calendar Embedding

• WorldCat Search + Book Covers + Ratings + Preview at Google Books

• WorldCat Search Holdings + Google Maps

• Journal List Enhancements

Page 57: Library Mashups & APIs

Web Services for Interoperability

• Lots of different ways in which people can access information

• Different devices

• Mobile devices, computers, special purpose devices

• Machine access to data

Page 58: Library Mashups & APIs

Mobile Catalog Prototype

• WorldCat Search API

• Open Library/LibraryThing Covers

• Summary - ISBNdb.com

• Full text/Preview

• Hathi Trust

• Google Books

• Screenscrape Item data