ddg: Add link to results page

master
mutantmonkey 2011-01-01 12:18:47 -05:00
parent bfb26c32d6
commit 5cfdd0e41c
1 changed files with 3 additions and 2 deletions

View File

@ -34,10 +34,11 @@ def ddg(phenny, input, celsius=False):
return phenny.reply(".ddg what?") return phenny.reply(".ddg what?")
uri = result(query) uri = result(query)
resultsuri = "https://duckduckgo.com/?q=" + web.urllib.quote(query.encode('utf-8'))
if uri: if uri:
phenny.reply("%s - Results from https://duckduckgo.com/" % uri) phenny.reply("%s - Results from %s" % (uri, resultsuri))
else: else:
phenny.reply("No results found for '%s'." % query) phenny.reply("No results found for '%s'; try %s" % (query, resultsuri))
ddg.rule = (['ddg'], r'(.*)') ddg.rule = (['ddg'], r'(.*)')
if __name__ == '__main__': if __name__ == '__main__':