yendo weblog


Google Sitemaps for Blosxom

久しぶりに blosxom 関連の情報をウェブで探していたら、 blosxom で運営されていた blog のいくつかが消えていたのに気付く。 blosxom は確かにもともとマイナーだけど、 さらに枯れてきたというか、廃れてきたのかもしれない。 blosxom が応えていた需要はどこに流れたのだろう。 ver.3 や pyblosxom 辺りに流れたのもそんなに多くはないだろうに。

さて、探し物は blosxom 用の Google Sitemaps ジェネレータだった。 ただ、結局見つからなかったので自力で適当に用意する。 真面目に flavour なり用意して xml を出力した方がいいのだが、 面倒なので既に利用しているプラグイン entriescache を改変して、一行一 URI のテキスト版サイトマップを吐くようにした。

--- entriescache.org	2005-08-05 07:19:56.000000000 +0900
+++ entriescache	2005-08-02 02:19:05.000000000 +0900
@@ -18,6 +18,7 @@
 
 $indexname = "$blosxom::plugin_state_dir/.entries_cache.index";
 $others_indexname = "$blosxom::plugin_state_dir/.entries_cache.others";
+$sitemap_indexname = "$blosxom::basedir/sitemap.txt";
 
 
 $use_date_tags = 1;			# Set to 1 to enable parsing meta- keywords
@@ -203,6 +204,19 @@
 				} else {
 					warn "couldn't > $others_indexname: $!\n";
 				}
+
+				# for Google sitemaps
+				if ( open ENTRIES, "> $sitemap_indexname" ) {
+				        print ENTRIES "$blosxom::url/\n";
+					foreach (sort keys %files) {
+					    $_ =~ s|$blosxom::datadir|$blosxom::url|;
+					    $_ =~ s/.txt/.html/;
+					    print ENTRIES "$_\n";
+					}
+					close ENTRIES;
+				} else {
+					warn "couldn't > $sitemap_indexname: $!\n";
+				}
 			}
 		}
 	return (\%files, \%indexes, \%others);

2005/08/05 (Fri) 07:22 | タグ: computer


同じカテゴリの最新記事

  1. GNOME 写真フレーム
  2. PyGTK でのバックグラウンド動作
  3. gnome-terminal の文字幅問題
  4. F-Spot の日本語メッセージカタログ
  5. Gtk2-Perl でのバックグラウンド動作