add tinyurl library and

This commit is contained in:
Rob Weber 2017-01-30 12:51:36 -06:00
parent 439c8aae28
commit d846cffd80

11
resources/lib/tinyurl.py Normal file
View 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)