aboutsummaryrefslogtreecommitdiffstats
path: root/slack.py
diff options
context:
space:
mode:
Diffstat (limited to 'slack.py')
-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)