<?
$xml = @$_GET['map'];
function pingsitemap($xml){
if(GoogleSitemaps($xml)==200){
echo "Sitemap <strong>Google Arama motoruna</strong> gönderildi. <br />";
}
if(BingSitemaps($xml)==200){
echo "Sitemap <strong>Bing Arama motoruna</strong> gönderildi.<br />";
}
}

function GoogleSitemaps( $url_xml )
{
$status = 0;
$google = 'www.google.com';
if( $fp=@fsockopen($google, 80) )
{
$req = 'GET /webmasters/sitemaps/ping?sitemap=' .
urlencode( $url_xml ) . " HTTP/1.1\r\n" .
"Host: $google\r\n" .
"User-Agent: Mozilla/5.0 (compatible; " .
PHP_OS . ") PHP/" . PHP_VERSION . "\r\n" .
"Connection: Close\r\n\r\n";
fwrite( $fp, $req );
while( !feof($fp) )
{
if( @preg_match('~^HTTP/\d\.\d (\d+)~i', fgets($fp, 128), $m) )
{
$status = intval( $m[1] );
break;
}
}
fclose( $fp );
}
return( $status );
}

function BingSitemaps($xml){
$status=0;
$bing="www.bing.com";
if( $fp=@fsockopen($bing, 80) )
{
$req = 'GET /webmaster/ping.aspx?siteMap=' .
urlencode( $xml ) . " HTTP/1.1\r\n" .
"Host: $bing\r\n" .
"User-Agent: Mozilla/5.0 (compatible; " .
PHP_OS . ") PHP/" . PHP_VERSION . "\r\n" .
"Connection: Close\r\n\r\n";
fwrite( $fp, $req );
while( !feof($fp) )
{
if( @preg_match('~^HTTP/\d\.\d (\d+)~i', fgets($fp, 128), $m) )
{
$status = intval( $m[1] );
break;
}
}
fclose( $fp );
}
return( $status );
}




?>