コード例 #1
0
def AddShortLink(blip, wave_id):
    wave_url = 'https://wave.google.com/wave/#restored:wave:%s' % wave_id
    wave_url = wave_url.replace('#', '%23')
    wave_url = wave_url.replace('+', '%252B')
    bitly = BitLy(bitlycred.LOGIN, bitlycred.KEY)
    short_url = bitly.shorten(wave_url)
    ModBlip(blip, short_url, [('link/manual', short_url),
                              ('style/fontSize', '1.5em')])
    ModBlip(blip, '\n', [('link/manual', None), ('style/fontSize', None)])
コード例 #2
0
 def testShortenURL(self):
     bitly = BitLy(bitlycred.LOGIN, bitlycred.KEY)
     short_url = bitly.shorten('http://www.chrishannam.co.uk')
     print short_url