updated some api stuff

This commit is contained in:
Luke Rogers 2012-02-16 07:18:56 +13:00
parent f75aeea2a9
commit a997e37718
5 changed files with 28 additions and 15 deletions

View file

@ -22,6 +22,8 @@ def tiny(url, user, apikey):
@hook.command
def shorten(inp, bot = None):
".shorten <url> - Makes an j.mp/bit.ly shortlink to the url provided"
user = bot.config['api_keys']['bitly_user']
api = bot.config['api_keys']['bitly_api']
return tiny(inp, user, api)
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"
return tiny(inp, api_user, api_key)