aboutsummaryrefslogtreecommitdiff
path: root/modules/upc.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-12-11 22:26:38 +0000
committerGravatar jesopo2018-12-11 22:26:38 +0000
commit793d234a0b924c0330e88f07f68b13559b42e4ac (patch)
tree90ecd3746a77e17da915f90ec057cb16ead82c05 /modules/upc.py
parentActually 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/upc.py')
-rw-r--r--modules/upc.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/upc.py b/modules/upc.py
index ed265f6e..31bd1b31 100644
--- a/modules/upc.py
+++ b/modules/upc.py
@@ -15,13 +15,13 @@ class Module(ModuleManager.BaseModule):
if not arg_len == 12 and not arg_len == 13:
raise utils.EventError("Invalid UPC/EAN/GTIN provided")
- page = utils.http.get_url(UPCITEMDB_URL,
+ page = utils.http.request(UPCITEMDB_URL,
get_params={"upc": event["args_split"][0]},
json=True)
if page:
- if not len(page["items"]):
+ if not len(page.data["items"]):
raise utils.EventError("UPC/EAN not found")
- item = page["items"][0]
+ item = page.data["items"][0]
brand = item.get("brand", None)
brand = "" if not brand else "%s - " % brand