feat: Add separate module to parse website data
All checks were successful
Build Docker / Build Main Image (push) Successful in 20s
Build Docker / Build SLDs Image (push) Successful in 19s

This commit is contained in:
Nathan Woodburn 2023-11-08 20:56:03 +11:00
parent 923858e47f
commit 303e0dddd1
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
2 changed files with 7 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import json
import schedule
import time
import db
import website
app = Flask(__name__)
@ -31,7 +32,7 @@ def index():
# Get website data
data = db.get_website_data(host)
# Render as HTML
return render_template_string(data)
return website.render(data)
@app.route('/<path:path>')

5
sites/website.py Normal file
View 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)