Switched to using is.gd for URL shortening

This commit is contained in:
Luke Rogers 2012-08-28 16:38:40 +12:00
parent 3fa8d5d312
commit 2871bd3211
4 changed files with 23 additions and 25 deletions

View file

@ -1,5 +1,6 @@
from util import hook
from util.web import bitly
from util.web import isgd
from urllib import quote_plus
@ -7,10 +8,6 @@ from urllib import quote_plus
@hook.command
def lmgtfy(inp, bot=None):
"lmgtfy [phrase] - Posts a google link for the specified phrase"
api_user = bot.config.get("api_keys", {}).get("bitly_user", None)
api_key = bot.config.get("api_keys", {}).get("bitly_api", None)
if api_key is None:
return "error: no api key set"
url = "http://lmgtfy.com/?q=%s" % quote_plus(inp)
return bitly(url, api_user, api_key)
return isgd(url, api_user, api_key)