summaryrefslogtreecommitdiff
path: root/lib/exe/indexer.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2006-11-17 16:00:30 +0100
committerAndreas Gohr <andi@splitbrain.org>2006-11-17 16:00:30 +0100
commit9046bb990b22efdc8a26f2b002f603c22f73f038 (patch)
tree55c00a5beed686c7771d18ef0535d5ccc2a1eca7 /lib/exe/indexer.php
parentc95706497c2894f9c0f6571478f8550d3418fe72 (diff)
downloadrpg-9046bb990b22efdc8a26f2b002f603c22f73f038.tar.gz
rpg-9046bb990b22efdc8a26f2b002f603c22f73f038.tar.bz2
sitemapper update
The Google sitemap protocol was recently adopted by Yahoo and Microsoft and made a common standard. This patch changes the XML namespace URL to the new sitmaps.org site and ups the version to 0.9 Pinging of Yahoo and Microsoft was added to the existing Google ping. The microsoft ping currently fails with a "Bad format" error for unknown reason. This will hopefully change when either Microsoft fixes their URL or releases some documentation. darcs-hash:20061117150030-7ad00-0fac1cba07926c3ffe687a8cbaf465e8de3abcd7.gz
Diffstat (limited to 'lib/exe/indexer.php')
-rw-r--r--lib/exe/indexer.php28
1 files changed, 24 insertions, 4 deletions
diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php
index a84d99a84..f5fc07bc3 100644
--- a/lib/exe/indexer.php
+++ b/lib/exe/indexer.php
@@ -251,7 +251,7 @@ function runSitemapper(){
// build the sitemap
ob_start();
print '<?xml version="1.0" encoding="UTF-8"?>'.NL;
- print '<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">'.NL;
+ print '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'.NL;
foreach($pages as $id){
$id = trim($id);
$file = wikiFN($id);
@@ -274,13 +274,33 @@ function runSitemapper(){
//save the new sitemap
io_saveFile(DOKU_INC.$sitemap,$data);
- print 'runSitemapper(): pinging google'.NL;
+ //ping search engines...
+ $http = new DokuHTTPClient();
+ $http->timeout = 8;
+
//ping google
+ print 'runSitemapper(): pinging google'.NL;
$url = 'http://www.google.com/webmasters/sitemaps/ping?sitemap=';
$url .= urlencode(DOKU_URL.$sitemap);
- $http = new DokuHTTPClient();
- $http->get($url);
+ $resp = $http->get($url);
+ if($http->error) print 'runSitemapper(): '.$http->error.NL;
+ print 'runSitemapper(): '.preg_replace('/[\n\r]/',' ',strip_tags($resp)).NL;
+
+ //ping yahoo
+ print 'runSitemapper(): pinging yahoo'.NL;
+ $url = 'http://search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid=dokuwiki&url=';
+ $url .= urlencode(DOKU_URL.$sitemap);
+ $resp = $http->get($url);
+ if($http->error) print 'runSitemapper(): '.$http->error.NL;
+ print 'runSitemapper(): '.preg_replace('/[\n\r]/',' ',strip_tags($resp)).NL;
+
+ //ping microsoft
+ print 'runSitemapper(): pinging microsoft'.NL;
+ $url = 'http://search.live.com/ping?sitemap=';
+ $url .= urlencode(DOKU_URL.$sitemap);
+ $resp = $http->get($url);
if($http->error) print 'runSitemapper(): '.$http->error.NL;
+ print 'runSitemapper(): '.preg_replace('/[\n\r]/',' ',strip_tags($resp)).NL;
print 'runSitemapper(): finished'.NL;
return true;