JavaScript Editor Ajax software     Free javascripts 



Main Page

Creating such a request programmatically is simple. For example, using the cURL library, the following
code would do the trick:
$sitemapUrl = SITE_DOMAIN . SITE_FOLDER . ‘/sitemap.xml’;
$pingUrl = “http://www.google.com/webmasters/sitemaps/ping?sitemap=” .
urlencode($sitemapUrl);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $pingUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);
Program logic can be implemented that executes the preceding code whenever changes occur to your
Google sitemap, such as whenever a product or content page is modified.
The Sitemaps.org Standard Protocol
At the time of writing, there is a brand new initiative in the works standardizing a search engine site
-
maps protocol for all search engine vendors. The standard and information is available at
http://
www.sitemaps.org/
. It adheres mostly to the Google standard, but its XML namespace is different:
<urlset xmlns=”http://www.google.com/schemas/sitemap/0.84”>
becomes:
<urlset xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9”>
Also, using this sitemaps protocol does not require creating any account with the particular search
engine vendors. Rather, you must simply “ping” a URL in the following format with the location of
the sitemap at least once (and optionally more when there are updates):
<searchengine_URL>/ping?sitemap=sitemap_url
At this time, the only search vendor adhering to this standard is Google — recognizing requests such as:
http://www.google.com/webmasters/sitemaps/ping?sitemap=www.example.com/sitemap.xml
MSN hasn’t implemented this functionality yet, but Yahoo! supports sitemap notification using this
(non-standard) request:
http://search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid=[YOUR_Y
AHOO_APPLICATION_ID]&url=http://www.example.com/sitemap.xml
To get a Yahoo Application ID visit
http://api.search.yahoo.com/webservices/
register_application
.
209
Chapter 9: Sitemaps
c09.qxd:c09 10:43 209


JavaScript Editor Ajax software     Free javascripts