From 110e58091180a4577c14af6069c8421d55914fa8 Mon Sep 17 00:00:00 2001 From: aewens Date: Thu, 15 Nov 2018 18:01:48 -0500 Subject: [PATCH] Better version than previous --- bot.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bot.py b/bot.py index 0e5ea01..c789ea9 100644 --- a/bot.py +++ b/bot.py @@ -1,5 +1,5 @@ import teambot, time, datastore -import lxml.html +from urllib.request import urlopen USAGE = dict(admin="Stop trying to use this command!",sotd="{}sotd ",listsotd="{}listsotd") PUBLIC_COMMANDS = ["sotd","listsotd"] @@ -7,8 +7,7 @@ PUBLIC_COMMANDS = ["sotd","listsotd"] SOTDS = datastore.DataStore("sotd.json") def get_title(link): - page = lxml.html.parse(link) - return page.find(".//title").text + return str(urlopen(link).read()).split("", 1)[1].split("", 1)[0]; class SOTDBot(teambot.Handler,teambot.CommandHandlerMixin): def __init__(self,*args):