benchmark-run.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /**
  2. * benchmark-run.js — Orchestrateur benchmark hebdomadaire
  3. *
  4. * Lance les deux scripts de collecte en séquence et affiche un résumé.
  5. *
  6. * Usage :
  7. * node scripts/benchmark-run.js [livinweb|livinia|all]
  8. * node scripts/benchmark-run.js ← traite toutes les marques
  9. *
  10. * Équivalent à lancer :
  11. * node scripts/benchmark-facebook-ads.js [brand]
  12. * node scripts/benchmark-communication.js [brand]
  13. */
  14. const { execSync } = require('child_process');
  15. const path = require('path');
  16. const brand = process.argv[2] || 'all';
  17. const scriptsDir = __dirname;
  18. function run(script, label) {
  19. console.log(`\n${'─'.repeat(50)}`);
  20. console.log(`🚀 ${label}`);
  21. console.log('─'.repeat(50));
  22. try {
  23. execSync(`node "${path.join(scriptsDir, script)}" ${brand}`, {
  24. stdio: 'inherit',
  25. cwd: path.resolve(scriptsDir, '..'),
  26. });
  27. } catch (err) {
  28. console.error(`❌ Erreur lors de ${label} :`, err.message);
  29. }
  30. }
  31. console.log(`\n📊 BENCHMARK HEBDOMADAIRE — Marque(s) : ${brand}`);
  32. console.log(` ${new Date().toLocaleDateString('fr-FR', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' })}`);
  33. run('benchmark-facebook-ads.js', 'Veille pubs Facebook (Meta Ad Library)');
  34. run('benchmark-communication.js', 'Veille communication (sites + LinkedIn)');
  35. console.log(`\n${'═'.repeat(50)}`);
  36. console.log('✅ Collecte terminée.');
  37. console.log(' Prochaine étape : lancer /agentmarketing-benchmark dans Cursor');
  38. console.log(' L\'agent analysera les fichiers générés et produira le rapport.');
  39. console.log('═'.repeat(50));