-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbooks filtering.py
60 lines (38 loc) · 1.21 KB
/
books filtering.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import googlebooks
import misc_python
def getBook():
api = googlebooks.Api()
isbn = "isbn:"
isbn += input("input isbn")
deets = api.list(isbn)
return str(deets)
def getTitle(data):
datastart = data.find('title') + 9
dataend = data.find('authors') - 4
return (data[datastart:dataend])
def getAuthor(data):
datastart = data.find('authors') + 12
dataend = data.find(']') - 1
return (data[datastart:dataend])
def getGenre(data):
datastart = data.find('categories') + 15
dataend = data.find("averageRating") - 5
return (data[datastart:dataend])
def getReleased(data):
datastart = data.find('publishedDate') + 17
dataend = data.find("description") - 4
return (data[datastart:dataend])
#BINDING???
def getAge(data):
datastart = data.find('maturityRating') + 18
dataend = data.find("allowAnonLogging") - 4
return (data[datastart:dataend])
def getBlurb(data):
datastart = data.find('description') + 15
dataend = data.find("industryIdentifiers") - 4
return (data[datastart:dataend])
def getImageURL(data):
datastart = data.find('thumbnail') + 13
dataend = data.find("language") - 5
return (data[datastart:dataend])
print(getTitle(getBook()))