-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathping_script.php
More file actions
29 lines (24 loc) · 895 Bytes
/
ping_script.php
File metadata and controls
29 lines (24 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
set_time_limit(0); // Süresiz çalışmasını sağlar
function pingSearchEngines($sitemapUrl)
{
$engines = [
"Google" => "https://www.google.com/ping?sitemap=$sitemapUrl",
"Bing" => "https://www.bing.com/ping?sitemap=$sitemapUrl",
"Yandex" => "https://yandex.com/indexnow?url=$sitemapUrl",
"DuckDuckGo" => "https://duckduckgo.com/?q=site:$sitemapUrl"
];
foreach ($engines as $name => $url) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
sleep(5); // Sunucu yükünü azaltmak için bekleme süresi
}
}
// Sürekli çalıştırma, her 20 dakikada bir çalıştırır
$sitemapUrl = $_SERVER["HTTP_HOST"]."sitemap.xml";
while (true) {
pingSearchEngines($sitemapUrl);
sleep(1200); // 20 dakika bekle
}