diff --git a/plugins/urbandictionary.py b/plugins/urbandictionary.py index a6b8ce1..4ca690a 100644 --- a/plugins/urbandictionary.py +++ b/plugins/urbandictionary.py @@ -14,12 +14,14 @@ def urban(inp): url = 'http://www.urbandictionary.com/define.php?term=' + \ urllib.quote(inp.strip(), safe='') page = html.parse(url) + words = page.xpath("//td[@class='word']") defs = page.xpath("//div[@class='definition']") if not defs: return 'no definitions found' - out = ' '.join(defs[0].text_content().split()) + out = words[0].text_content().strip() + ' '.join( + defs[0].text_content().split()) if len(out) > 400: out = out[:out.rfind(' ', 0, 400)] + '...'