Actualiser api.php

This commit is contained in:
2026-06-25 14:02:18 +02:00
parent b153499f84
commit 757d50dd28
+24
View File
@@ -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;
}
?>