I've created a few functions that will open a few urls and then use a regex to look for keywords. They work great in Bash but when I try to add them to my app they page won't load. Here are the two functions and return page:
def looper(sites):
a = []
for x in sites:
a += [urllib.urlopen(x)]
return a
def reader(var):
b = []
for x in var:
b += [re.findall(r'Please', x.read())]
return b
@app.route('/looper1')
def looper1():
site = ['http://tlamanna42.pythonanywhere.com', 'http://tlamanna42.pythonanywhere.com']
c = looper(site)
d = reader(c)
return d
I know the sites are whitelisted and again it works just fine in the console, but when I try to use it in the app itself it won't load.