diff options
| author | 2018-12-11 22:26:38 +0000 | |
|---|---|---|
| committer | 2018-12-11 22:26:38 +0000 | |
| commit | 793d234a0b924c0330e88f07f68b13559b42e4ac (patch) | |
| tree | 90ecd3746a77e17da915f90ec057cb16ead82c05 /modules/books.py | |
| parent | Actually use `action_desc` in github.py.issues, so that we can see what things (diff) | |
| signature | ||
'utils.http.get_url' -> 'utils.http.request', return a Response object from
utils.http.request
Diffstat (limited to 'modules/books.py')
| -rw-r--r-- | modules/books.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/books.py b/modules/books.py index d10cdd32..aa059b27 100644 --- a/modules/books.py +++ b/modules/books.py @@ -9,11 +9,11 @@ class Module(ModuleManager.BaseModule): _name = "ISBN" def get_book(self, query, event): - page = utils.http.get_url(URL_GOOGLEBOOKS, get_params={ + page = utils.http.request(URL_GOOGLEBOOKS, get_params={ "q": query, "country": "us"}, json=True) if page: - if page["totalItems"] > 0: - book = page["items"][0]["volumeInfo"] + if page.data["totalItems"] > 0: + book = page.data["items"][0]["volumeInfo"] title = book["title"] sub_title = (", %s" % book.get("subtitle") ) if book.get("subtitle") else "" |
