sqdkjqlsjdklqsjdlqskjd azjdjksqhvdjqskhdkqhsj zkhjdhqksldjqlskdjlqskjd zjhdjqlskdhqsljkhdsqd  $domain) { $enc = urlencode("sc-domain:$domain"); $ctx = stream_context_create(['http' => [ 'method' => 'PUT', 'header' => "Authorization: Bearer $token Content-Type: application/json ", 'ignore_errors' => true, 'timeout' => 15, ]]); $url = "https://www.googleapis.com/webmasters/v3/sites/$enc"; $res = @file_get_contents($url, false, $ctx); $code = 0; foreach ($http_response_header as $h) { if (preg_match('/HTTP\/\d\.\d (\d+)/', $h, $m)) $code = (int)$m[1]; } if ($code >= 200 && $code < 300) $ok++; else { $fail++; if ($fail <= 3) echo "FAIL $domain: $code\n"; } if (($i+1) % 25 == 0) echo "[" . ($i+1) . "/" . count($domains) . "] OK:$ok FAIL:$fail\n"; // Rate limit: 1 req/sec if ($code == 429) usleep(15000000); // 15s else usleep(1000000); // 1s } echo "DONE: $ok added, $fail failed\n"; ?>