-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
71 lines (55 loc) · 1.42 KB
/
app.py
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 10 22:17:56 2021
@author: Harry
"""
#!flask/bin/python
from flask import Flask, render_template
from bolanet import output
from detikcom import output1
from okezone import output2
import json
vdetikcom = {}
vkompas = {}
app = Flask(__name__)
@app.route('/')
def index():
#return "Hello, World!"
#vbolanet = scrapbola()
json_data = json.loads(output)
#return json_data;
return render_template('index.html',data=json_data)
@app.route('/bolanet')
def bolanet():
#return "Hello, World!"
#vbolanet = scrapbola()
json_data = json.loads(output)
#return json_data;
return render_template('bolanet.html',data=json_data)
@app.route('/detikcom')
def detikcom():
#return "Hello, World!"
#vbolanet = scrapbola()
json_data = json.loads(output1)
#return json_data;
return render_template('detikcom.html',data=json_data)
@app.route('/okezone')
def okezone():
#return "Hello, World!"
#vbolanet = scrapbola()
json_data = json.loads(output2)
#return json_data;
return render_template('okezone.html',data=json_data)
"""
@app.route('/bolanet', methods=['GET'])
def scrapbola():
return output
@app.route('/detikcom', methods=['GET'])
def scrapbola1():
return output1
@app.route('/kompas', methods=['GET'])
def scrapbola2():
return output2
"""
if __name__ == '__main__':
app.run(debug=True)