Re: Google Books Dynamic Links API and Python

From: Michael Beccaria <mbeccaria_at_nyob>
Date: Thu, 2 Oct 2008 09:12:35 -0400
To: CODE4LIB_at_LISTSERV.ND.EDU
Scratch that, the code is simpler. Serves me right for not checking
things twice:
import urllib,urllib2
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor())
request =
urllib2.Request('http://books.google.com/books?bibkeys=0618379436&jscmd=
viewapi&callback=mycallback')
opener.addheaders = [('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT
5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')]
data = opener.open(request).read()
print data

Mike Beccaria 
Systems Librarian 
Head of Digital Initiatives 
Paul Smith's College 
518.327.6376 
mbeccaria_at_paulsmiths.edu 
 
Received on Thu Oct 02 2008 - 07:35:41 EDT