Ping Google Sitemaps
Yazan: ayhan,DigerTags/Kelimeler: Google Sitemap, Php, ping, Ping Google Sitemaps, Sitemap
Adı üstünde , sitemap dosyanızı google ' a tekrar göndermek için kullanılan bir yöntem. Basitçe, sitemap i tekrar post ediyorsunuz
-
<?php
-
/**
-
* Function to ping Google Sitemaps.
-
*
-
* Function to ping Google Sitemaps. Returns an integer, e.g. 200 or 404,
-
* 0 on error.
-
*
-
* @author J de Silva <giddomains@gmail.com>
-
* @copyright Copyright © 2005, J de Silva
-
* @link http://www.gidnetwork.com/b-54.html PHP function to ping Google Sitemaps
-
* @param string $url_xml The sitemap url, e.g. http://www.example.com/google-sitemap-index.xml
-
* @return integer Status code, e.g. 200|404|302 or 0 on error
-
*/
-
function pingGoogleSitemaps( $url_xml )
-
{
-
$status = 0;
-
$google = 'www.google.com';
-
{
-
$req = 'GET /webmasters/sitemaps/ping?sitemap=' .
-
"Host: $google\r\n" .
-
"User-Agent: Mozilla/5.0 (compatible; " .
-
PHP_OS . ") PHP/" . PHP_VERSION . "\r\n" .
-
"Connection: Close\r\n\r\n";
-
{
-
{
-
break;
-
}
-
}
-
}
-
return( $status );
-
}
-
?>
Örnek Kullanım :
$sonuc = pingGoogleSitemaps('http://www.ayhanbaris.com/sitemap-adresiniz.xml');
if ($sonuc == 200) {
echo "işlem tamam";
}
Entries (RSS)