Added get_title
This commit is contained in:
parent
16c8052ee8
commit
d77dd8b828
4
bot.py
4
bot.py
|
@ -1,4 +1,5 @@
|
|||
import teambot, time, datastore
|
||||
import lxml.html
|
||||
|
||||
USAGE = dict(admin="Stop trying to use this command!",sotd="{}sotd <link> <name>",listsotd="{}listsotd")
|
||||
PUBLIC_COMMANDS = ["sotd","listsotd"]
|
||||
|
@ -6,7 +7,8 @@ PUBLIC_COMMANDS = ["sotd","listsotd"]
|
|||
SOTDS = datastore.DataStore("sotd.json")
|
||||
|
||||
def get_title(link):
|
||||
return link # TODO: actually make this get the title of a link.
|
||||
page = lxml.html.parse(link)
|
||||
return page.find(".//title").text
|
||||
|
||||
class SOTDBot(teambot.Handler,teambot.CommandHandlerMixin):
|
||||
def __init__(self,*args):
|
||||
|
|
Reference in New Issue