poslední změny

This commit is contained in:
2025-10-20 13:49:38 +02:00
parent 561a91d023
commit 89e32b1d28
9 changed files with 40 additions and 76 deletions

7
app.py
View File

@@ -1,4 +1,5 @@
from flask import Flask, render_template, request, send_file, jsonify, make_response
from flask import Flask, render_template, request, send_file, jsonify
from datetime import datetime
from scraper import get_google_first_page
import io, json, csv, yaml, os
from dotenv import load_dotenv
@@ -34,7 +35,9 @@ def export():
ext = data.get("format", "json")
results = data.get("results", [])
filename = f"results.{ext}"
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
filename = f"results_{timestamp}.{ext}"
if ext == "json":
buf = io.BytesIO(json.dumps(results, ensure_ascii=False, indent=2).encode("utf-8"))