From ff0479f2ecee8df1a2b040efa99451f8858681f8 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Mon, 19 Oct 2015 20:39:21 +0200 Subject: Switched to the official bitly API library. --- gitnoti.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gitnoti.py b/gitnoti.py index b6aefcf..e9c9d40 100755 --- a/gitnoti.py +++ b/gitnoti.py @@ -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 -- cgit v1.2.3