feat: Add separate module to parse website data
This commit is contained in:
parent
923858e47f
commit
303e0dddd1
@ -6,6 +6,7 @@ import json
|
|||||||
import schedule
|
import schedule
|
||||||
import time
|
import time
|
||||||
import db
|
import db
|
||||||
|
import website
|
||||||
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
@ -31,7 +32,7 @@ def index():
|
|||||||
# Get website data
|
# Get website data
|
||||||
data = db.get_website_data(host)
|
data = db.get_website_data(host)
|
||||||
# Render as HTML
|
# Render as HTML
|
||||||
return render_template_string(data)
|
return website.render(data)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/<path:path>')
|
@app.route('/<path:path>')
|
||||||
|
5
sites/website.py
Normal file
5
sites/website.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
from flask import Flask, make_response, redirect, render_template_string, request, jsonify, render_template, send_from_directory
|
||||||
|
|
||||||
|
|
||||||
|
def render(data):
|
||||||
|
return render_template_string(data)
|
Loading…
Reference in New Issue
Block a user