mirror of
https://github.com/robweber/xbmcbackup.git
synced 2024-11-14 20:35:48 +01:00
add tinyurl library and
This commit is contained in:
parent
439c8aae28
commit
d846cffd80
11
resources/lib/tinyurl.py
Normal file
11
resources/lib/tinyurl.py
Normal file
@ -0,0 +1,11 @@
|
||||
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)
|
Loading…
Reference in New Issue
Block a user