Fix bug in title.py (and convert spaces to tabs), thanks @rubenwardy

master
sfan5 2014-07-25 20:40:11 +02:00
parent fa55206611
commit d9318b8f53
1 changed files with 25 additions and 24 deletions

View File

@ -10,13 +10,14 @@ import web
r_title = re.compile(r'(?ims)<\s*title[^>]*>(.*?)<\s*/\s*title\s*>')
def title(phenny, input):
uri = input.group(2).strip()
uri = input.group(2)
if uri:
pass
elif hasattr(phenny.bot, 'last_seen_uri'):
uri = phenny.bot.last_seen_uri
else:
return phenny.reply("Give me an URI..")
uri = uri.strip()
data, sc = web.get(uri, 4096)
if sc != 200:
return phenny.say("HTTP error %d" % sc)