1
0

verify_opengraph.sh 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #!/bin/bash
  2. # Script de vérification des améliorations Open Graph
  3. # Usage: ./verify_opengraph.sh
  4. echo "🔍 VÉRIFICATION DES AMÉLIORATIONS OPEN GRAPH"
  5. echo "=============================================="
  6. echo ""
  7. # Couleurs
  8. GREEN='\033[0;32m'
  9. RED='\033[0;31m'
  10. YELLOW='\033[1;33m'
  11. NC='\033[0m' # No Color
  12. # Compteur
  13. checks_passed=0
  14. checks_failed=0
  15. # Fonction de vérification
  16. check_file() {
  17. if [ -f "$1" ]; then
  18. echo -e "${GREEN}✅${NC} $2"
  19. ((checks_passed++))
  20. else
  21. echo -e "${RED}❌${NC} $2"
  22. ((checks_failed++))
  23. fi
  24. }
  25. check_content() {
  26. if grep -q "$2" "$1" 2>/dev/null; then
  27. echo -e "${GREEN}✅${NC} $3"
  28. ((checks_passed++))
  29. else
  30. echo -e "${RED}❌${NC} $3"
  31. ((checks_failed++))
  32. fi
  33. }
  34. echo "📁 Vérification des fichiers..."
  35. echo "--------------------------------"
  36. check_file "blog/seo_helpers.py" "Fichier seo_helpers.py présent"
  37. check_file "blog/templates/read.html" "Template read.html présent"
  38. check_file "test_opengraph.py" "Script de test présent"
  39. check_file "OPEN_GRAPH_GUIDE.md" "Guide Open Graph créé"
  40. check_file "AMELIORATION_OPENGRAPH.md" "Résumé des améliorations créé"
  41. echo ""
  42. echo "🔧 Vérification du code..."
  43. echo "--------------------------------"
  44. check_content "blog/seo_helpers.py" "get_image_url" "Fonction get_image_url() ajoutée"
  45. check_content "blog/seo_helpers.py" "default_image" "Image par défaut configurée"
  46. check_content "blog/seo_helpers.py" "twitter_handle" "Handle Twitter configuré"
  47. check_content "blog/templates/read.html" "og:image:width" "Dimensions d'image Open Graph ajoutées"
  48. check_content "blog/templates/read.html" "twitter:card" "Twitter Cards intégrées"
  49. check_content "blog/templates/read.html" "application/ld+json" "Schema.org JSON-LD présent"
  50. echo ""
  51. echo "📊 Résumé"
  52. echo "=================================="
  53. echo -e "Tests réussis : ${GREEN}${checks_passed}${NC}"
  54. echo -e "Tests échoués : ${RED}${checks_failed}${NC}"
  55. if [ $checks_failed -eq 0 ]; then
  56. echo ""
  57. echo -e "${GREEN}🎉 Toutes les vérifications sont OK !${NC}"
  58. echo ""
  59. echo "📝 Prochaines étapes :"
  60. echo " 1. Lire AMELIORATION_OPENGRAPH.md pour le guide rapide"
  61. echo " 2. Lire OPEN_GRAPH_GUIDE.md pour le guide complet"
  62. echo " 3. Tester avec : python test_opengraph.py [url]"
  63. echo " 4. Publier un article avec une belle image (1200x630)"
  64. echo ""
  65. exit 0
  66. else
  67. echo ""
  68. echo -e "${YELLOW}⚠️ Certaines vérifications ont échoué${NC}"
  69. echo "Consultez les messages ci-dessus pour plus de détails"
  70. echo ""
  71. exit 1
  72. fi