summaryrefslogtreecommitdiffstats
path: root/modules/head.py
diff options
context:
space:
mode:
Diffstat (limited to 'modules/head.py')
-rwxr-xr-xmodules/head.py9
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__':