source: google_book_util.py @ 22:8fc267f35ca1

Revision 22:8fc267f35ca1, 399 bytes checked in by hagenbruch@phoibe.ub.rub.de, 7 years ago (diff)

Some bug fixes. Added support for spell checking, journal covers, author pages...

Line 
1import urllib2
2
3def google_book(isbn):
4    req = urllib2.Request('http://books.google.com/books?vid=ISBN%s' % isbn)
5    req.add_header('User-agent', 'Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9) Gecko/2008052912 Firefox 3.0')
6    try:
7        urllib2.urlopen(req).info()
8        return 'http://books.google.com/books?vid=ISBN%s' % isbn
9    except urllib2.HTTPError, e:
10        return unicode(e.code)
Note: See TracBrowser for help on using the repository browser.