

def short(self, url):
    shorten_url = '{0}{1}'.format(self.api_url, 'v3/shorten')
    params = dict(uri=url, access_token=self.token, format='txt')
    response = self._get(shorten_url, params=params)
    if response.ok:
        return response.text.strip()
    raise ShorteningErrorException('There was an error shortening this url - {0}'.format(response.content))

dataset/ETHPy150Open ellisonleao/pyshorteners/pyshorteners/shorteners/bitly.py Bitly.short/original