def count_clicks(token, link):
    response = requests.get('https://api-ssl.bitly.com/v4/bitlinks/{0}{1}/clicks/summary'.format(link.netloc, link.path), headers={'Authorization': 'Bearer {}'.format(token)})
    response.raise_for_status()
    return response.json()['total_clicks']
def count_clicks(token, link):
    response = requests.get('https://api-ssl.bitly.com/v4/bitlinks/{0}{1}/clicks/summary'.format(link.netloc, link.path), headers={'Authorization': 'Bearer {}'.format(token)})
    response.raise_for_status()
    return response.json()['total_clicks']