diff --git a/search.py b/search.py new file mode 100644 index 0000000..52e451c --- /dev/null +++ b/search.py @@ -0,0 +1,182 @@ +import os +import json +from flask import Flask, render_template_string, request, jsonify + +app = Flask(__name__) + +# Load all JSON files from current directory +DATA = [] +FILES = [f for f in os.listdir('.') if f.endswith('.json')] +for f in FILES: + with open(f, 'r', encoding='utf-8') as file: + try: + messages = json.load(file) + for msg in messages: + msg['source'] = f.replace('.json', '') + DATA.extend(messages) + except Exception: + pass + +# HTML Template with modern UI +HTML = """ + + +
+