Commit 9699bf46 authored by Mindiell's avatar Mindiell
Browse files

Added url title shower

parent 80cfaf6a
......@@ -54,4 +54,7 @@ Utilisation: !kill <url de l'article>
"""Bravo les neurones, rien en retard depuis ces %s derniers jours!""",
"""Titre: %s (à %s)""",
......@@ -119,6 +119,21 @@ class Wantzel(object):
self.kill(user, channel, msg)
elif command=="stats":
self.stats(user, channel, msg)
# Whatever is done, get the title of an existing url in a message
if "http" in msg:
content = ""
title = ""
website = ""
url ="(http[^ ]*)", msg).group(1)
website ="//([^/]*)", url).group(1)
f = urllib.URLopener().open(url)
content =
title ="<title>([^<]+)</title>", content).group(1)
if title and website:
self.send_message(channel, messages["title"] % (title, website))
def on_joined(self, channel):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment