def short(self, url):
        params = json.dumps({'longUrl': url})
        headers = {'content-type': 'application/json'}
        url = '{0}?key={1}'.format(self.api_url, self.api_key)
        response = self._post(url, data=params, headers=headers)
        if response.ok:
            try:
                data = response.json()
            except __HOLE__ as e:
                raise ShorteningErrorException('There was an error shortening'
                                               ' this url - {0}'.format(e))
            if 'id' in data:
                return data['id']
        raise ShorteningErrorException('There was an error shortening this '
                                       'url - {0}'.format(response.content))
dataset/ETHPy150Open ellisonleao/pyshorteners/pyshorteners/shorteners/googl.py/Google.short