added date to .bq and fixed encoding bug on url titles
This commit is contained in:
parent
7504a2d342
commit
72e432c46c
|
@ -16,4 +16,5 @@ def BQstatus(bot, trigger):
|
||||||
deathdate = "[2017-02-16 00:19:00]"
|
deathdate = "[2017-02-16 00:19:00]"
|
||||||
msg = "Banished Quest status: " + status + "\nTime since death: "
|
msg = "Banished Quest status: " + status + "\nTime since death: "
|
||||||
msg += relativeTime(bot.config, datetime.now(), deathdate) + " ago "
|
msg += relativeTime(bot.config, datetime.now(), deathdate) + " ago "
|
||||||
|
msg += deathdate
|
||||||
bot.msg(msg)
|
bot.msg(msg)
|
||||||
|
|
|
@ -51,5 +51,6 @@ def title_auto(bot, trigger):
|
||||||
title = res.text[res.text.find("<title>")+7:res.text.find("</title>")]
|
title = res.text[res.text.find("<title>")+7:res.text.find("</title>")]
|
||||||
title = HTMLParser().unescape(title)
|
title = HTMLParser().unescape(title)
|
||||||
title = title.replace("\n","").strip()
|
title = title.replace("\n","").strip()
|
||||||
|
title = title.encode("latin-1").decode("utf-8")
|
||||||
hostname = urlparse(url).hostname
|
hostname = urlparse(url).hostname
|
||||||
bot.msg(f"[ \x0310{title} \x03] - \x0304{hostname}")
|
bot.msg(f"[ \x0310{title} \x03] - \x0304{hostname}")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user