Skip to content

Commit

Permalink
あとでやる
Browse files Browse the repository at this point in the history
  • Loading branch information
nesosuke committed Mar 20, 2020
1 parent fb6eaf6 commit ce76485
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions bookapi.py
@@ -1,24 +1,3 @@
#「Google BooksでAPIを叩く」のモジュール化試行
import requests

if __name__ == "__main__":
def info(Isbn):
response = requests.get(
'https://www.googleapis.com/books/v1/volumes',
params={
"q": "isbn=" + str(Isbn)
}
)
BookInfo = dict(response.json()).get("items")[0]["volumeInfo"]

BookTitle = BookInfo["title"]
BookAuthors = BookInfo["authors"][0]

def info(Isbn):
return BookInfo

def title(Isbn):
return BookTitle

def authors(Isbn):
return BookAuthors
あとでやる

0 comments on commit ce76485

Please sign in to comment.