use future for urllib2

This commit is contained in:
Rob Weber
2019-08-27 15:03:43 -05:00
parent 8f8402ae8a
commit 94f872fb81
4 changed files with 6 additions and 4 deletions

View File

@ -1,10 +1,10 @@
import urllib2
from future.moves.urllib.request import urlopen
#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)
req = urlopen(tinyurl + aUrl)
data = req.read()
#should be a tiny url