#!/bin/bash # Script de vérification des améliorations Open Graph # Usage: ./verify_opengraph.sh echo "🔍 VÉRIFICATION DES AMÉLIORATIONS OPEN GRAPH" echo "==============================================" echo "" # Couleurs GREEN='\033[0;32m' RED='\033[0;31m' YELLOW='\033[1;33m' NC='\033[0m' # No Color # Compteur checks_passed=0 checks_failed=0 # Fonction de vérification check_file() { if [ -f "$1" ]; then echo -e "${GREEN}✅${NC} $2" ((checks_passed++)) else echo -e "${RED}❌${NC} $2" ((checks_failed++)) fi } check_content() { if grep -q "$2" "$1" 2>/dev/null; then echo -e "${GREEN}✅${NC} $3" ((checks_passed++)) else echo -e "${RED}❌${NC} $3" ((checks_failed++)) fi } echo "📁 Vérification des fichiers..." echo "--------------------------------" check_file "blog/seo_helpers.py" "Fichier seo_helpers.py présent" check_file "blog/templates/read.html" "Template read.html présent" check_file "test_opengraph.py" "Script de test présent" check_file "OPEN_GRAPH_GUIDE.md" "Guide Open Graph créé" check_file "AMELIORATION_OPENGRAPH.md" "Résumé des améliorations créé" echo "" echo "🔧 Vérification du code..." echo "--------------------------------" check_content "blog/seo_helpers.py" "get_image_url" "Fonction get_image_url() ajoutée" check_content "blog/seo_helpers.py" "default_image" "Image par défaut configurée" check_content "blog/seo_helpers.py" "twitter_handle" "Handle Twitter configuré" check_content "blog/templates/read.html" "og:image:width" "Dimensions d'image Open Graph ajoutées" check_content "blog/templates/read.html" "twitter:card" "Twitter Cards intégrées" check_content "blog/templates/read.html" "application/ld+json" "Schema.org JSON-LD présent" echo "" echo "📊 Résumé" echo "==================================" echo -e "Tests réussis : ${GREEN}${checks_passed}${NC}" echo -e "Tests échoués : ${RED}${checks_failed}${NC}" if [ $checks_failed -eq 0 ]; then echo "" echo -e "${GREEN}🎉 Toutes les vérifications sont OK !${NC}" echo "" echo "📝 Prochaines étapes :" echo " 1. Lire AMELIORATION_OPENGRAPH.md pour le guide rapide" echo " 2. Lire OPEN_GRAPH_GUIDE.md pour le guide complet" echo " 3. Tester avec : python test_opengraph.py [url]" echo " 4. Publier un article avec une belle image (1200x630)" echo "" exit 0 else echo "" echo -e "${YELLOW}⚠️ Certaines vérifications ont échoué${NC}" echo "Consultez les messages ci-dessus pour plus de détails" echo "" exit 1 fi