Projects/worblehat-old
Projects
/
worblehat-old
Archived
12
0
Fork 0
This repository has been archived on 2024-07-04. You can view files and clone it, but cannot push or open issues or pull requests.
worblehat-old/python/google_interface.py

19 lines
577 B
Python

from web.library.models import *
from gdata.books.service import BookService
exit_commands = ['exit', 'abort', 'quit', 'bye', 'eat flaming death', 'q']
def get_book_loop():
service = BookService(source='Programvareverkstedet - Worblehat - 0.1a ')
while True:
input = raw_input('Enter ISBN number> ')
if input in exit_commands:
break
feed = service.search_by_keyword('isbn='+input)
if len(feed.entry) == 0:
print "No items found"
elif len(feed.entry) == 1:
print "Found one item: "+feed.entry[0].title.text
else:
print "Found several items, OWNOES!"