diff options
-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 |