Skip to content

Commit

Permalink
xkcd: …
Browse files Browse the repository at this point in the history
  • Loading branch information
Guilhem Saurel committed Aug 17, 2018
1 parent 1f8d894 commit bcfb9c7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions xkcd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ def __init__(self, bot):
def extract_data(self, html_content):
data = loads(html_content)
ret = u"Mandatory XKCD: {title} -- https://xkcd.com/{num}/ ({day}/{month}/{year})".format(**data)
return {
'text': ret,
'xhtml': u'<a href="https://xkcd.com/%i"><img alt="%s" src="%s" /></a>' % (data['num'], ret, data['img']),
}
# TODO : TypeError: 'unicode' object does not support item assignment
# return {
# 'text': ret,
# 'xhtml': u'<a href="https://xkcd.com/%i"><img alt="%s" src="%s" /></a>' % (data['num'], ret, data['img'])
# }
return ret


class XKCDTest(ModuleTest):
Expand Down

0 comments on commit bcfb9c7

Please sign in to comment.