()
| 21764 | |
| 21765 | @app.route('/api/social/snapshot', methods=['POST']) |
| 21766 | def api_social_snapshot(): |
| 21767 | payload = request.json or {} |
| 21768 | target = str(payload.get('target') or "").strip() |
| 21769 | platform = _normalize_instagram_platform(payload.get('platform')) |
| 21770 | if not platform: |
| 21771 | return jsonify({"error": "Supportata solo la piattaforma Instagram"}), 400 |
| 21772 | source = str(payload.get('source') or "api/social/snapshot").strip() or "api/social/snapshot" |
| 21773 | if not target: |
| 21774 | return jsonify({"error": "target mancante"}), 400 |
| 21775 | try: |
| 21776 | snap = core.social_snapshot(target, platform, source=source) |
| 21777 | except Exception as e: |
| 21778 | return jsonify({"error": f"snapshot fallito: {e}"}), 500 |
| 21779 | if not isinstance(snap, dict): |
| 21780 | return jsonify({"error": "snapshot non disponibile"}), 500 |
| 21781 | return jsonify(snap) |
| 21782 | |
| 21783 | @app.route('/api/social/diff', methods=['POST']) |
| 21784 | def api_social_diff(): |
nothing calls this directly
no test coverage detected