This repository has been archived on 2023-04-13. You can view files and clone it, but cannot push or open issues or pull requests.
CloudBot/plugins/lmgtfy.py
2013-09-27 20:48:01 +12:00

14 lines
335 B
Python

from util import hook, web, http
@hook.command('gfy')
@hook.command
def lmgtfy(inp):
"""lmgtfy [phrase] - Posts a google link for the specified phrase"""
link = u"http://lmgtfy.com/?q={}".format(http.quote_plus(inp))
try:
return web.isgd(link)
except (web.ShortenError, http.HTTPError):
return link