From 757d50dd28e53513e0d1227f14e09436d16dc0e0 Mon Sep 17 00:00:00 2001 From: Cedric Date: Thu, 25 Jun 2026 14:02:18 +0200 Subject: [PATCH] Actualiser api.php --- api.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/api.php b/api.php index a3289bf..3721687 100644 --- a/api.php +++ b/api.php @@ -689,5 +689,29 @@ switch ($action) { 'imgs' => $imgList ], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE); break; + + case 'test_covercentury': + $title = $_GET['title'] ?? 'Matrix'; + $year = $_GET['year'] ?? ''; + + // URLs possibles à tester + $urls = [ + "https://www.covercentury.com/index.php?p=recherche&recherche=" . urlencode($title), + "https://www.covercentury.com/?s=" . urlencode($title), + "https://www.covercentury.com/search/" . urlencode($title), + "https://www.covercentury.com/index.php?recherche=" . urlencode($title), + ]; + + $results = []; + foreach ($urls as $url) { + $html = httpGet($url, 8); + $results[] = [ + 'url' => $url, + 'length' => $html ? strlen($html) : 0, + 'snippet' => $html ? substr(strip_tags($html), 0, 200) : 'ERREUR' + ]; + } + echo json_encode($results, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE); + break; } ?> \ No newline at end of file