HTTPS title support, and a minor encoding fix.

master
Sean B. Palmer 2010-12-23 19:34:03 +00:00
parent 5ebe01386d
commit 01cebd1ccc
2 changed files with 3 additions and 1 deletions

View File

@ -168,7 +168,7 @@ def noteuri(phenny, input):
if not hasattr(phenny.bot, 'last_seen_uri'): if not hasattr(phenny.bot, 'last_seen_uri'):
phenny.bot.last_seen_uri = {} phenny.bot.last_seen_uri = {}
phenny.bot.last_seen_uri[input.sender] = uri phenny.bot.last_seen_uri[input.sender] = uri
noteuri.rule = r'.*(http://[^<> "\x01]+)[,.]?' noteuri.rule = r'.*(http[s]?://[^<> "\x01]+)[,.]?'
noteuri.priority = 'low' noteuri.priority = 'low'
if __name__ == '__main__': if __name__ == '__main__':

View File

@ -46,6 +46,8 @@ def tr(phenny, context):
if input != output: if input != output:
msg = translate(phrase, input, output) msg = translate(phrase, input, output)
if isinstance(msg, str):
msg = msg.decode('utf-8')
if msg: if msg:
msg = web.decode(msg) # msg.replace('&#39;', "'") msg = web.decode(msg) # msg.replace('&#39;', "'")
msg = '"%s" (%s to %s, translate.google.com)' % (msg, input, output) msg = '"%s" (%s to %s, translate.google.com)' % (msg, input, output)