diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2015-10-19 20:39:21 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2015-10-19 20:39:21 +0200 |
commit | ff0479f2ecee8df1a2b040efa99451f8858681f8 (patch) | |
tree | d329fe25b31b685cbbb13a97fe1135a6a3b470b2 | |
parent | bcaac23c3c4f066612f9a2e45105acdf6152de0e (diff) |
Switched to the official bitly API library.hooks
-rwxr-xr-x | gitnoti.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -24,7 +24,7 @@ from twisted.internet.task import LoopingCall have_bitly = False try: - import bitly + import bitly_api have_bitly = True except: pass @@ -141,8 +141,9 @@ def repo_commit_msg(repo, branch, commits): short_url = None try: bitly_auth = netrc.netrc().authenticators('bitly') - bitly_api = bitly.Api(login = bitly_auth[0], apikey = bitly_auth[2]) - short_url = bitly_api.shorten(url) + bitly = bitly_api.Connection(login = bitly_auth[0], access_token = bitly_auth[2]) + r = bitly.shorten(url) + short_url = r['url'] except: short_url = None |