1
0
mirror of https://github.com/robweber/xbmcbackup.git synced 2025-01-11 15:15:48 +01:00
xbmcbackup/resources/lib/tinyurl.py
2017-01-30 12:51:36 -06:00

12 lines
339 B
Python

import urllib2
#this is duplicated in snipppets of code from all over the web, credit to no one
#in particular - to all those that have gone before me!
def shorten(aUrl):
tinyurl = 'http://tinyurl.com/api-create.php?url='
req = urllib2.urlopen(tinyurl + aUrl)
data = req.read()
#should be a tiny url
return str(data)