Actualiser api.php
This commit is contained in:
@@ -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;
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user