{% if p.has_profile_photo is not none %}
{{ '✓' if p.has_profile_photo else '✗' }} Zdjęcie profilowe
{% else %}
? Zdjęcie profilowe
{% endif %}
{% if p.has_cover_photo is not none %}
{{ '✓' if p.has_cover_photo else '✗' }} Zdjęcie w tle
{% else %}
? Zdjęcie w tle
{% endif %}
{% if p.has_bio is not none %}
{{ '✓' if p.has_bio else '✗' }} Opis / bio
{% else %}
? Opis / bio
{% endif %}
{% if p.profile_description %}
{{ p.profile_description[:300] }}{% if p.profile_description|length > 300 %}...{% endif %}
{% endif %}
{% if p.content_types %}
{% set ct = p.content_types %}
{% set info_fields = [] %}
{% if ct.get('phone') %}{% if info_fields.append(('📞', ct.phone)) %}{% endif %}{% endif %}
{% if ct.get('emails') %}{% for e in ct.emails %}{% if info_fields.append(('✉️', e)) %}{% endif %}{% endfor %}{% endif %}
{% if ct.get('address') %}{% if info_fields.append(('📍', ct.address)) %}{% endif %}{% endif %}
{% if ct.get('website') %}{% if info_fields.append(('🌐', ct.website)) %}{% endif %}{% endif %}
{% if ct.get('category') %}{% if info_fields.append(('🏷️', ct.category)) %}{% endif %}{% endif %}
{% if ct.get('founded') %}{% if info_fields.append(('📅', 'Założono: ' ~ ct.founded)) %}{% endif %}{% endif %}
{% if ct.get('price_range') %}{% if info_fields.append(('💰', 'Ceny: ' ~ ct.price_range)) %}{% endif %}{% endif %}
{% if ct.get('hours') %}{% if info_fields.append(('🕐', 'Godziny otwarcia ustawione')) %}{% endif %}{% endif %}
{% if ct.get('username') %}{% if info_fields.append(('🔗', '@' ~ ct.username)) %}{% endif %}{% endif %}
{% if ct.get('verification_status') == 'blue_verified' or ct.get('is_verified') %}{% if info_fields.append(('✅', 'Zweryfikowana')) %}{% endif %}{% endif %}
{% if info_fields %}
{% for icon, val in info_fields %}
{{ icon }} {{ val }}
{% endfor %}
{% endif %}
{% if ct.get('talking_about_count') or ct.get('overall_star_rating') or ct.get('were_here_count') or ct.get('category_list') %}
{% for ptype, count in ct.post_types.items() %}
{{ ptype }}: {{ count }}
{% endfor %}
{% endif %}
{# Meta deprecated impressions metrics on 2026-06-30. New: page_media_view, page_total_media_view_unique. Fallback to old keys for historical data. #}
{% set page_views_metric = ct.get('insights_page_total_media_view_unique') or ct.get('insights_page_impressions') %}
{% set page_video_metric = ct.get('insights_page_media_view') or ct.get('insights_page_video_views') %}
{% set page_reach_metric = ct.get('insights_page_posts_impressions') %}
{% set has_insights = page_views_metric or ct.get('insights_page_views_total') or ct.get('insights_page_post_engagements') or page_reach_metric or ct.get('insights_page_daily_follows') %}
{% if has_insights %}
📊 Insights (28 dni)
{% if page_reach_metric %}{{ "{:,}".format(page_reach_metric).replace(",", " ") }} zasięg postów{% endif %}
{% if page_views_metric %}{{ "{:,}".format(page_views_metric).replace(",", " ") }} wyświetleń strony{% endif %}
{% if ct.get('insights_page_views_total') %}{{ "{:,}".format(ct.insights_page_views_total).replace(",", " ") }} odsłon strony{% endif %}
{% if ct.get('insights_page_post_engagements') %}{{ "{:,}".format(ct.insights_page_post_engagements).replace(",", " ") }} interakcji{% endif %}
{% if page_video_metric %}{{ "{:,}".format(page_video_metric).replace(",", " ") }} odsłon wideo{% endif %}
{% if ct.get('insights_page_daily_follows') %}+{{ ct.insights_page_daily_follows }} nowych obserwujących{% endif %}
{% if ct.get('insights_page_daily_unfollows') %}-{{ ct.insights_page_daily_unfollows }} utraconych{% endif %}
{% if ct.get('insights_page_fan_adds') %}+{{ ct.insights_page_fan_adds }} nowych fanów{% endif %}
{% if ct.get('insights_page_fan_removes') %}-{{ ct.insights_page_fan_removes }} utraconych fanów{% endif %}
Połącz {{ p.platform|capitalize }} API przez OAuth, aby uzyskać dokładne dane (followers, engagement, insights).Połącz OAuth →
{% endif %}
{% else %}
{% if p.platform == 'instagram' %}
Dane Instagram wymagają połączenia z Meta API. Aby pobierać statystyki: (1) konto IG musi być typu Business/Creator, (2) musi być powiązane ze stroną Facebook firmy, (3) firma musi mieć podłączony Facebook OAuth na portalu.
{% elif p.platform == 'twitter' %}
Dane pobierane automatycznie przez Twitter API (bez OAuth). Uruchom skan, aby pobrać aktualne statystyki.
{% elif p.platform == 'youtube' %}
Dane pobierane automatycznie przez YouTube Data API v3 (bez OAuth). Uruchom skan, aby pobrać aktualne statystyki.
{% elif p.platform == 'facebook' %}
Facebook blokuje publiczny dostęp. Podłącz Graph API (OAuth) w ustawieniach firmy, aby pobierać dane.
{% else %}
OAuth API niedostępne dla {{ p.platform|capitalize }}. Dane pochodzą ze scrapingu publicznych profili.
{% endif %}