diff --git a/modules/networking/__init__.py b/modules/networking/__init__.py index 670c423..188dbb5 100644 --- a/modules/networking/__init__.py +++ b/modules/networking/__init__.py @@ -3,6 +3,7 @@ """Various network tools (w3m, w3c validator, curl, traceurl, ...)""" import logging +import re from nemubot.exception import IRCException from nemubot.hooks import hook @@ -37,6 +38,20 @@ def help_full(): return "!traceurl /url/: Follow redirections from /url/." +@hook("cmd_hook", "title") +def cmd_title(msg): + if not len(msg.args): + raise IRCException("Indicate the URL to visit.") + + url = " ".join(msg.args) + res = re.search("