Tagged: mashlib

Library Catalogue SRU Queries via YQL and Yahoo Pipes

I got a question from @liwazi last week wondering why a SRU request to the Cambridge Library catalogue wasn’t being handled properly in Yahoo pipes… I think it’s because the Yahoo Pipes XML parser is sometimes like that!

Anyway, here was my fix – to use YQL as a proxy, based around a SRU request URL of the form:
http://search.lib.cam.ac.uk/sru.ashx?version=1.1&recordSchema=dc&query=SEARCH+TERMS
&operation=searchRetrieve&maximumRecords=10

Here’s the the form of YQL query (try it in YQL developer console):

select * from xml where url='http://search.lib.cam.ac.uk/sru.ashx?version=1.1&recordSchema=dc&query=SEARCH+TERMSsearchRetrieve&maximumRecords=10'

You can find a copy of the pipe here: SRU demo pipe

Note that as well as accessing the data via the pipe, you can also pull the results of a search into a web page directly from YQL as a JSON feed:

If you’re really keen, you might also define a YQL data table that would allow you to make a request of the form “select * from camsru where q=’learning perl'”, and then set up a short alias for the query so you could run it using a construction of the form http://query.yahooapis.com/v1/public/yql/EXAMPLEUSER/camsru?q=learning%20perl based on a YQL query of the form select * from camsru where q=@q

PS tomorrow is Mashed Library day at Lincoln – Pancakes and Mash. Be sure to follow #mashlib and chip in if you can ;-)