From 5d50d54671c6a17802995715ee24c318f28a8dfd Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Tue, 8 Apr 2014 23:45:34 -0700 Subject: [PATCH] update snarfuri to exclude command-line lines * Exclude lines from being matched by snarfuri that begin with . * Enable posted time display by the posted module --- modules/head.py | 6 +++--- modules/posted.py | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/head.py b/modules/head.py index bbb4499..330ebda 100644 --- a/modules/head.py +++ b/modules/head.py @@ -88,12 +88,12 @@ noteuri.priority = 'low' def snarfuri(phenny, input): - uri = input.group(1) + uri = input.group(2) title = gettitle(phenny, input, uri) if title: phenny.msg(input.sender, title) -snarfuri.rule = r'.*(http[s]?://[^<> "\x01]+)[,.]?' +snarfuri.rule = r'([^\.].*)?(http[s]?://[^<> "\x01]+)[,.]?' snarfuri.priority = 'low' snarfuri.thread = True @@ -195,4 +195,4 @@ def gettitle(phenny, input, uri): if __name__ == '__main__': - print(__doc__.strip()) \ No newline at end of file + print(__doc__.strip()) diff --git a/modules/posted.py b/modules/posted.py index bba5e0f..3200477 100644 --- a/modules/posted.py +++ b/modules/posted.py @@ -61,11 +61,9 @@ def posted(phenny, input): posted = check_posted(phenny, input, url) if posted: - # when the day comes when you can inhibit snarfuri if modules are called - # phenny.reply("URL was posted {0}".format(posted)) - pass + phenny.reply("URL was posted {0}".format(posted)) else: phenny.reply("I don't remember seeing this URL in this channel.") posted.thread = False -posted.commands = ["posted"] \ No newline at end of file +posted.commands = ["posted"]