diff options
author | Sean B. Palmer <http://inamidst.com/sbp/> | 2008-03-31 16:17:32 +0100 |
---|---|---|
committer | Sean B. Palmer <http://inamidst.com/sbp/> | 2008-03-31 16:17:32 +0100 |
commit | 286d4a8497621d2f3c0f1f8d66db60b11c87fad5 (patch) | |
tree | 23493e843bcb1a1d6b25346a3dfd6290df46d5ba /modules/head.py | |
parent | fb2cd452e963b8bc048161036903cd82d3b113f0 (diff) | |
download | bot-286d4a8497621d2f3c0f1f8d66db60b11c87fad5.tar.gz bot-286d4a8497621d2f3c0f1f8d66db60b11c87fad5.tar.bz2 bot-286d4a8497621d2f3c0f1f8d66db60b11c87fad5.zip |
New "limit" config variable, and some module fixes.
Diffstat (limited to 'modules/head.py')
-rwxr-xr-x | modules/head.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/head.py b/modules/head.py index 2552d6f..c271de1 100755 --- a/modules/head.py +++ b/modules/head.py @@ -21,7 +21,8 @@ def head(phenny, input): else: uri, header = uri, None if not uri and hasattr(phenny, 'last_seen_uri'): - uri = phenny.last_seen_uri + try: uri = phenny.last_seen_uri[input.sender] + except KeyError: return phenny.say('?') try: info = web.head(uri) except IOError: return phenny.say("Can't connect to %s" % uri) @@ -67,9 +68,9 @@ def f_title(self, origin, match, args): uri = (uri or '').encode('utf-8') if not uri and hasattr(self, 'last_seen_uri'): - uri = self.last_seen_uri.get('#swhack') + uri = self.last_seen_uri.get(origin.sender) if not uri: - return phenny.msg(origin.sender, 'I need a URI to give the title of...') + return self.msg(origin.sender, 'I need a URI to give the title of...') if not ':' in uri: uri = 'http://' + uri @@ -145,7 +146,7 @@ def noteuri(phenny, input): if not hasattr(phenny.bot, 'last_seen_uri'): phenny.bot.last_seen_uri = {} phenny.bot.last_seen_uri[input.sender] = uri -noteuri.rule = r'.*(http://[^<> "]+)[,.]?' +noteuri.rule = r'.*(http://[^<> "\x01]+)[,.]?' noteuri.priority = 'low' if __name__ == '__main__': |