MCPcopy Create free account
hub / github.com/CScorza/IntelOSINT / api_reports_examples

Function api_reports_examples

IntelOSINT.py:22079–22109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22077
22078@app.route('/api/reports/examples', methods=['GET'])
22079def api_reports_examples():
22080 denied = require_authenticated_download("reports_examples", limit=10, window=60)
22081 if denied:
22082 return denied
22083 out = {}
22084 # Esempio report generale (/api/export)
22085 sample_data = [{
22086 "username": "demo_target",
22087 "type": "Instagram",
22088 "info": {"Status": "Trovato", "Follower": "1234", "Bio": "Profilo dimostrativo"}
22089 }]
22090 gen_bytes = ReportGenerator().generate(sample_data)
22091 gen_key = f"example-generic-{uuid.uuid4().hex}"
22092 gen_path = Path(tempfile.gettempdir()) / f"{gen_key}.pdf"
22093 gen_path.write_bytes(gen_bytes if isinstance(gen_bytes, (bytes, bytearray)) else bytes(gen_bytes))
22094 MEDIA_EXPORTS[gen_key] = {"path": str(gen_path), "name": "CScorza_Report_Esempio_Generale.pdf"}
22095 out["generic"] = f"/api/media/download/{gen_key}"
22096
22097 # Esempio report Telegram
22098 tg_lines = [
22099 "[2026-05-03 10:00:00] AVVIO MONITORAGGIO",
22100 "[2026-05-03 10:01:00] UTENTE ONLINE",
22101 "[2026-05-03 10:03:00] Username cambiato da old a new",
22102 "[2026-05-03 10:05:00] MONITORAGGIO TERMINATO"
22103 ]
22104 safe_id = f"example_{uuid.uuid4().hex[:8]}"
22105 log_file = Path(f"TG_Monitor_{safe_id}.txt")
22106 log_file.write_text("\n".join(tg_lines), encoding="utf-8")
22107 out["telegram"] = f"/api/tg/export_report?target={safe_id}"
22108
22109 return jsonify({"status": "ok", "examples": out})
22110
22111def _parse_semver(v):
22112 raw = str(v or "").strip().lower().lstrip("v")

Callers

nothing calls this directly

Calls 3

ReportGeneratorClass · 0.85
generateMethod · 0.80

Tested by

no test coverage detected