<?xml version="1.0" encoding="UTF-8" ?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Posteet: google,yahoo</title> 
    <link>http://www.posteet.com/</link> 
    <description>Recent posteets posted to Posteet</description>
    <ttl>60</ttl>

    
    <item>
        <title>Notifier google, yahoo et ask de la mise à jour d'un sitemap</title>
        <link>http://www.posteet.com/view/482</link>
        <description>
        <![CDATA[<pre>$sitemapUrl = 'http://www.monsite.com/sitemap.xml';

//google
$google_return = pingSitemap($sitemapUrl, 'http://www.google.com/webmasters/sitemaps/ping?sitemap=');
//ask
$ask_return = pingSitemap($sitemapUrl, 'http://submissions.ask.com/ping?sitemap=');
//yahoo
$yahoo_return = pingSitemap($sitemapUrl, 'http://search.yahooapis.com/SiteExplorerService/V1/ping?sitemap=');

echo $google_return;
echo $ask_return;
echo $yahoo_return;

function pingSitemap ($sitemapUrl, $notifyUrl) {

    $fileName = $notifyUrl . urlencode($sitemapUrl);

    $url = parse_url($fileName);
    if (!isset($url[&quot;port&quot;])) $url[&quot;port&quot;] = 80;
    if (!isset($url[&quot;path&quot;])) $url[&quot;path&quot;] = &quot;/&quot;;

    $fp = @fsockopen($url[&quot;host&quot;],
                     $url[&quot;port&quot;],
                     &amp;$errno, &amp;$errstr, 30);

    if ($fp) {
        $head = &quot;&quot;;
        $httpRequest = &quot;HEAD &quot;. $url[&quot;path&quot;] .&quot;?&quot;
                     .$url[&quot;query&quot;] .&quot; HTTP/1.1\r\n&quot;
                     .&quot;Host: &quot;. $url[&quot;host&quot;] .&quot;\r\n&quot;
                     .&quot;Connection: close\r\n\r\n&quot;;

        fputs($fp, $httpRequest);
        while(!feof($fp)) $head .= fgets($fp, 1024);
        fclose($fp);

        return $head;

    }

return &quot;ERROR&quot;;

}</pre> <a href="http://www.posteet.com/tags/ask">[ask]</a>  <a href="http://www.posteet.com/tags/google">[google]</a>  <a href="http://www.posteet.com/tags/php">[php]</a>  <a href="http://www.posteet.com/tags/sitemap">[sitemap]</a>  <a href="http://www.posteet.com/tags/yahoo">[yahoo]</a> ]]>        </description>
        <dc:creator>spirit</dc:creator>
        <pubDate>Mon, 19 Nov 2007 18:58:09 +0000</pubDate>

            <category>ask</category>
            <category>google</category>
            <category>php</category>
            <category>sitemap</category>
            <category>yahoo</category>
    
    </item>


</channel>
</rss>
