SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist Alchemist's Avatar
    Join Date
    Aug 2006
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP function to ping yahoo

    hello,

    first of all, is it possible to ping yahoo to notify them a new urllist has been updated? if yes, is there a PHP function similar to the one below I can use to achieve that?

    thank you very much!

    Code:
    //====================================// 
     function pingGoogleSitemap ( $rootUrl ) {
    //====================================// 
    
        $fileName = "http://www.google.com/webmasters/sitemaps/ping?sitemap=" .urlencode("$rootUrl/sitemap.xml");
    
        $url = parse_url($fileName);
        if (!isset($url["port"])) $url["port"] = 80;
        if (!isset($url["path"])) $url["path"] = "/";
    
        $fp = @fsockopen($url["host"],
                         $url["port"],
                         &$errno, &$errstr, 30);
    
        if ($fp) {
            $head = "";
            $httpRequest = "HEAD ". $url["path"] ."?"
                         .$url["query"] ." HTTP/1.1\r\n"
                         ."Host: ". $url["host"] ."\r\n"
                         ."Connection: close\r\n\r\n";
    
            fputs($fp, $httpRequest);
            while(!feof($fp)) $head .= fgets($fp, 1024);
            fclose($fp);
    
            return $head;
    
        }
    
    return "ERROR";
    
    }

  2. #2
    SitePoint Evangelist Alchemist's Avatar
    Join Date
    Aug 2006
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    any idea? anyone? thanks


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •