aboutsummaryrefslogtreecommitdiff
path: root/modules/imgur.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/imgur.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/imgur.py')
-rw-r--r--modules/imgur.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/imgur.py b/modules/imgur.py
index 1b3bfadf..bcfce572 100644
--- a/modules/imgur.py
+++ b/modules/imgur.py
@@ -20,12 +20,12 @@ class Module(ModuleManager.BaseModule):
def _image_info(self, hash):
api_key = self.bot.config["imgur-api-key"]
- result = utils.http.get_url(URL_IMAGE % hash,
+ result = utils.http.request(URL_IMAGE % hash,
headers={"Authorization": "Client-ID %s" % api_key},
json=True)
- if result and result["success"]:
- data = result["data"]
+ if result and result.data["success"]:
+ data = result.data["data"]
text = self._prefix(data)
text += "(%s %dx%d, %d views)" % (data["type"], data["width"],
@@ -38,12 +38,12 @@ class Module(ModuleManager.BaseModule):
def _gallery_info(self, hash):
api_key = self.bot.config["imgur-api-key"]
- result = utils.http.get_url(URL_GALLERY % hash,
+ result = utils.http.request(URL_GALLERY % hash,
headers={"Authorization": "Client-ID %s" % api_key},
json=True)
- if result and result["success"]:
- data = result["data"]
+ if result and result.data["success"]:
+ data = result.data["data"]
text = self._prefix(data)
text += "(%d views, %d▲▼%d)" % (data["views"],
data["ups"], data["downs"])