aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2015-11-07 16:32:29 -0500
committerGuillaume Horel <guillaume.horel@gmail.com>2015-11-07 17:06:11 -0500
commitf8367663d358b410b821d8cd34e2ac8ad449b8d9 (patch)
treec771b3d826976e9240f2c56e1aec826dd999815e
parentf039016ad17cc13a68e7ee96c50168967acabeba (diff)
downloadslack-f8367663d358b410b821d8cd34e2ac8ad449b8d9.tar.gz
tentative fix
-rw-r--r--slack.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/slack.py b/slack.py
index c6c9faf..e31061d 100644
--- a/slack.py
+++ b/slack.py
@@ -15,11 +15,14 @@ def echo():
@app.route("/xkcd", methods=['POST'])
def xkcd_view():
- title, url = get_xkcd(request.form['text'])
+ comic_id = request.form['text']
+ title, url = get_xkcd(comic_id)
d = {'response_type': 'in_channel',
- 'text': title,
'attachments': [
- {'image_url':"http:{0}:".format(url)}
+ {'image_url':"http:{0}".format(url),
+ 'title': title,
+ 'title_link': 'http://www.xkcd.org/{0}'.format(comic_id)
+ }
]
}
return jsonify(d)