utility.py

changeset 121
ac07779f788d
parent 120
9880bb697149
child 123
aeb0d0788869
equal deleted inserted replaced
120:9880bb697149 121:ac07779f788d
8 if bitly_token: 8 if bitly_token:
9 c = bitly_api.Connection (access_token = bitly_token) 9 c = bitly_api.Connection (access_token = bitly_token)
10 try: 10 try:
11 return c.shorten (link)['url'] 11 return c.shorten (link)['url']
12 except Exception as e: 12 except Exception as e:
13 Irc.broadcast ('Error while shortening link %s: %s' % (link, e)) 13 Irc.broadcast ('Error while shortening link "%s": %s' % (link, e))
14 14
15 return link 15 return link

mercurial