Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to enable ping search engine Yandex
#1
how to enable ping search engine Yandex?
Code:
$yandex ='www.yandex.ru';
      if( $fp=@fsockopen($yandex, 80) ) {
      $req =  'GET /webmaster.yandex.ru/ping?sitemap=' .
              urlencode( $url_xml ) . " HTTP/1.1\r\n" .
              "Host: $yandex\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 );
   }
Reply


Messages In This Thread
how to enable ping search engine Yandex - by Oleg06 - 2013-02-10, 07:56:05



Users browsing this thread: 1 Guest(s)