Files
html/api/ambre-check-wire.php

16 lines
575 B
PHP

<?php
header("Content-Type: application/json");
$out = [];
foreach (["wevia-master.html", "wevia-orchestrator.html", "director-chat.html", "l99-brain.html"] as $p) {
$f = "/var/www/html/$p";
if (!file_exists($f)) { $out[$p] = "missing"; continue; }
$c = @file_get_contents($f);
$out[$p] = [
"size" => strlen($c),
"widget" => substr_count($c, "ambre-universal-chat.js"),
"last_body_pos" => strrpos($c, "</body>"),
"ends_with" => substr(trim($c), -200),
];
}
echo json_encode($out, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);