trim leading xkcd from title
This commit is contained in:
parent
823ca9eeb4
commit
2a4bc5a9f6
2
xkcd.py
2
xkcd.py
|
@ -13,6 +13,8 @@ class Module(ModuleManager.BaseModule):
|
||||||
page = utils.http.request(url)
|
page = utils.http.request(url)
|
||||||
if page:
|
if page:
|
||||||
title = page.soup().title.contents[0]
|
title = page.soup().title.contents[0]
|
||||||
|
if title.startswith("xkcd: "):
|
||||||
|
title = title[6:]
|
||||||
event["stdout"].write("%s: %s" % (title, url))
|
event["stdout"].write("%s: %s" % (title, url))
|
||||||
else:
|
else:
|
||||||
event["stderr"].write("Unable to fetch xkcd")
|
event["stderr"].write("Unable to fetch xkcd")
|
||||||
|
|
Loading…
Reference in New Issue