aboutsummaryrefslogtreecommitdiff
path: root/modules/upc.py
diff options
context:
space:
mode:
Diffstat (limited to 'modules/upc.py')
-rw-r--r--modules/upc.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/upc.py b/modules/upc.py
index 37588481..96e53042 100644
--- a/modules/upc.py
+++ b/modules/upc.py
@@ -2,8 +2,10 @@ import Utils
UPCITEMDB_URL = "https://api.upcitemdb.com/prod/trial/lookup"
+
class Module(object):
_name = "UPC"
+
def __init__(self, bot):
self.bot = bot
bot.events.on("received").on("command").on(
@@ -18,8 +20,8 @@ class Module(object):
return
page = Utils.get_url(UPCITEMDB_URL,
- get_params={"upc": event["args_split"][0]},
- json=True)
+ get_params={"upc": event["args_split"][0]},
+ json=True)
if page:
if not len(page["items"]):
event["stderr"].write("UPC/EAN not found")
@@ -47,7 +49,8 @@ class Module(object):
lowest_price, highest_price, currency)
event["stdout"].write("%s%s%s(weight: %s"
- ", size: %s, price: %s)" % (
- brand, title, description, weight, size, pricing))
+ ", size: %s, price: %s)" % (
+ brand, title, description, weight, size,
+ pricing))
else:
event["stderr"].write("Failed to load results")