Friday, December 22, 2006

google-search-api-client-for-

Google Search API client for Common Lisp

I'm currently writing a web-application in Common Lisp which needs to use the Google Search API, a SOAP webservice. (It will replace my PHP-based FindMeATune thing).

Google's API provides a WSDL file, that is a descriptor of the service for SOAP client software. Unfortunately, cl-soap, the major SOAP client library for Common Lisp, doesn't seem to like that WSDL file. So, I had to write my own client, using CL-SOAP in a somewhat more low-level way. (In fact, it would probably have been nearly as easy to use S-XML and a random HTTP client).

It's pretty simple; it provides a function 'search' which takes at least a query and your Google Search API key, and processes the returned (XML) data into a list of (url, title, summary) tuples.

If this sounds useful, you can download it here: google-api-client.lisp (1.9kb). It works on at least SBCL 1 for Linux/x86 and a recent version of OpenMCL on MacOS X(PPC). Let me know if you have any trouble. I'll probably put together an asdf-install-able package at some point.

No comments:

Post a Comment