File size: 694 Bytes
f2fffda
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from flask import Flask, render_template, request
from webscout import WEBS
import arrow

app = Flask(__name__)

@app.route('/', methods=['GET'])
def home():
    keywords = request.args.get('keywords', 'india')
    timelimit = request.args.get('timelimit', 'd')
    text_list = []
    with WEBS() as webs_instance:
        WEBS_images_gen = webs_instance.text(
          keywords,
          region="wt-wt",
          safesearch="off",
          timelimit=timelimit,
          max_results=100
        )
        for r in WEBS_images_gen:
            text_list.append(r)
    return render_template('text.html', text=text_list, keywords=keywords)

if __name__ == '__main__':
    app.run(debug=True)