()
| 21782 | |
| 21783 | @app.route('/api/social/diff', methods=['POST']) |
| 21784 | def api_social_diff(): |
| 21785 | payload = request.json or {} |
| 21786 | target = str(payload.get('target') or "").strip() |
| 21787 | platform = _normalize_instagram_platform(payload.get('platform')) |
| 21788 | if not platform: |
| 21789 | return jsonify({"error": "Supportata solo la piattaforma Instagram"}), 400 |
| 21790 | newer_id = payload.get('newer_id') |
| 21791 | older_id = payload.get('older_id') |
| 21792 | if not target: |
| 21793 | return jsonify({"error": "target mancante"}), 400 |
| 21794 | history = core._read_social_snapshot_history(target, platform, limit=SOCIAL_SNAPSHOT_HISTORY_LIMIT) |
| 21795 | if not history: |
| 21796 | return jsonify({"error": "Nessuna snapshot disponibile", "target": target, "platform": platform}), 404 |
| 21797 | result = _normalize_social_diff_records(history, newer_id=newer_id, older_id=older_id) |
| 21798 | if result.get("error"): |
| 21799 | return jsonify(result), 404 |
| 21800 | return jsonify(result) |
| 21801 | |
| 21802 | @app.route('/api/social/snapshot/history', methods=['GET']) |
| 21803 | def api_social_snapshot_history(): |
nothing calls this directly
no test coverage detected