urbandict: strip whitespace, trim at 256 chars

master
mutantmonkey 2011-12-26 22:19:23 -05:00
parent 2db37270a7
commit d127556c67
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ def urbandict(phenny, input):
result = data['list'][0] result = data['list'][0]
url = 'http://www.urbandictionary.com/define.php?term={0}'.format(urlquote(word)) url = 'http://www.urbandictionary.com/define.php?term={0}'.format(urlquote(word))
response = "{0} - {1}".format(result['definition'], url) response = "{0} - {1}".format(result['definition'].strip()[:256], url)
phenny.say(response) phenny.say(response)
urbandict.rule = (['urb'], r'(.*)') urbandict.rule = (['urb'], r'(.*)')