2008/07/23

はてな
少しずつですがバージョンアップしています。
The Unofficial Blosxom User Group :: Blosxom 2.1.0 released

New features

  • Support for external config files and multi-instance installations via environment variables. (Inspired and loosely based on the Debian patches for Blosxom 2.0.2.)
  • Support for multiple plugin directories using $plugin_path and @INC.
  • Support for configuring the plugins to use in a config file.
  • The default feed templates are now in RSS 2.0 format and prevent duplicated stories in feed readers or aggregators if posts are changed after publishing using a GUID element in each feed item.
  • There's now an encoding setting which controls what charset your blog and feeds should be marked as.
http://blosxom.ookee.com/blog/news/blosxom-2.1.0-released.html
バージョンアップの内容としては以下の通り。
  • 環境変数によるconfigファイルの読み込み
  • 複数のプラグインディレクトリをサポート
  • configファイルによるpluginの設定が可能に
  • デフォルトのRSSフィードがRSS2.0に
  • encodingの設定が可能に
また幾らかのバグフィックスも含んでいます。さっそくこのサイトでも導入しました。大きな修正点はありませんでしたがRSS1.0からRSS2.0に修正した事でフィードリーダに更新が配信されてしまったかと思います。
configファイルはmod_envを使って
SetEnv BLOSXOM_CONFIG_FILE /path/to/my/blosxom/config/file/bloxsom.conf
とすることでblosxom.cgiを全く弄らずに動かす事が出来る様になりました。

しばらくは様子見です。

2008/03/24

はてな
The Unofficial Blosxom User Group :: Using Blosxom as Feed Generator

Gavin Carr, one of the Blosxom developers, recently posted a simple yet somehow not obvious idea on his blog: He uses Blosxom to automatically generate feeds for software which hasn't feeds, in this case the network monitoring system Nagios, so that he get's all Nagios events delivered to his feed reader.

A similar yet local use of this idea is to let blosxom or a wrapper script be called by your feed reader directly. Liferea (GUI, GNOME) and Snownews (text-mode, ncurses) have this feature and there is already a big repository of plugins. The same way as those plugins are called, you can easily use blosxom as a plugin to those two feed readers so you don't need to care about how to generate RSS, blosxom does that for you. You just need to set the environment variable PATH_INFO to /index.rss before, e.g. by calling blosxom like this: env PATH_INFO=/index.rss blosxom.

That way I currently monitor the NVidia Unix Drivers Portal Page for changes, using this script, the libwww-perl (LWP), wdiff, a little bit of Perl glue and of course Blosxom. (In this case I use Debian's version of Blosxom which is able to have several configuration per installation by adding a -f flag for config files.)

blosxomの開発者の一人、Gavin Carr氏がblosxomを使って面白いアイデアを出しているようです。
Hackery :: Blosxom4Nagiosと題した記事に記されている中では、Nagiosというモニタリングシステムの結果をフィード化するにあたり、snownewsやLifereaといったクライアント向けフィードリーダのフィード読み込みコマンドを利用するという例が紹介されています。
実際には記事の中で紹介されている、changes2rss.plというperlスクリプト内からblosxomを実行し、結果をRSSとして出力するという代物です。
なかなか面白いアイデアですね。フィード読み込みコマンドをサポートしているフィードリーダでしか有効ではないですが
  • 情報収集
  • システム監視
を同じフィードリーダで扱えるというのは便利かもしれません。

2007/10/30

はてな
最近は技術情報ばかり書く機会が多く、このブログにメールから投稿する事はあまりなくなりましたが、もしかすると需要はあるかもしれないので...
blosxomをXMLRC経由でポストするスクリプトBXR(blosxom-xmlrpc.cgi)をWindows Live Writerからポストするとサーバ側でパースに失敗していました。
調べた結果、Windows Live WriterはXMLの先頭にBOMを付けてくれるらしく、XMLRPC::Transport::HTTP::CGIがパースエラーを起こしてました。
とりあえず私の所は応急処置で、User-Agentを見て先頭3バイトを削るワークアラウンドで逃げる事にしました。
またWindows Live WriterはcategoryNameとcategoryIdを正しく区別出来ていないようなので、こちらもUser-Agentを見てcategoryIdのみ処理するよう修正しました。
※Windows用にbinmodeしたほうがいいかもしれない。

これで外部XMLRPCキッカー(sidebar.jp等)を使用したモブログ、ブログエディタ等でポスト出来るようになります。

ダウンロード:blosxom-xmlrpc.cgi-20071030.diff

2007/08/15

はてな
ClickCommentsのようなものを作ってしまったよ!

このページの下(Writebacks)に動くものがあるよ!
クリックすると「なると」が増えるよ!
なんで「なると」なのかは聞かないでね!
使うときは、フレーバに
$naruto::link
と書くといいよ!
あくまでblosxomとJSONで何か作ってみたかっただけだから、実用性ないよ!
もしかしたらWeb拍手みたいに使えるかもしれないよ!

blosxom大好きっ子は、これを改造してバラまいてClickCommentsのシェアをどんどん下げちゃえばいいと思うよ!!!

元ネタ
http://d.hatena.ne.jp/amachang/20070807/1186485054
http://d.hatena.ne.jp/Hamachiya2/20070804/browser_crasher
amachang、はまちちゃん、勝手にテンプレート使ってごめんね!><
ダウンロード:naruto


2007/07/03

はてな
Livedoor Readerの海外版、「FastLadder」が公開されました。
FeedFetcherのユーザエージェントは、LDRとそっくり「Fastladder FeedFetcher/0.01」でした。
さて、弄り倒しますか。

fastladder-20070703

あわせて「フィード購読者数カウンタ for blosxom」も修正しました。
ダウンロード:sbm.cgi

2007/06/26

はてな
実は、ここのサーバのJcode.pmがちゃんと動いてなかった事に気づいた。

最近トラックバックスパムがやたらと文字化けを起こすなぁ...って思ってたんです。まぁ、相手のサーバの文字コードなんかお構い無しに放り投げてくるのがスパム!な訳ですから、化けてあたりまえ...
いや待てよ、blosxomのwritebackプラグインでJcode::convert変換してたはず。しかもutf8でだ。
で、ようやく重い腰をあげる。

調べてる内に、ここのサーバではJcode.pmがutf8で全滅している事に気づいた。
このサーバではXSは置けないのでJcode::Unicode::NoXSが動いているものとばかり思っていたのだが、いやいや...

うんちゃらかんちゃら、弄ってる内にメンドクサクなってきたので、ついいつもの適当ハック癖...。
Jcode/Unicode/NoXS.pm内のメソッドをJcode::XXXからJcode::_Classic::XXXに一括痴漢^H^H置換して、お茶を濁す。

--- Jcode/Unicode/NoXS.pm.orig  2007-06-26 00:31:47.000000000 +0900
+++ Jcode/Unicode/NoXS.pm   2007-06-26 03:23:49.000000000 +0900
@@ -53,7 +53,7 @@
 # instead of being 'use'd (No package export done) subs below
 # belong to Jcode, not Jcode::Unicode

-sub Jcode::ucs2_euc{
+sub Jcode::_Classic::ucs2_euc{
     my $thingy = shift;
     my $r_str = ref $thingy ? $thingy : \$thingy;
     _init_u2e();
@@ -68,7 +68,7 @@
     $$r_str;
 }

-sub Jcode::euc_ucs2{
+sub Jcode::_Classic::euc_ucs2{
     my $thingy = shift;
     my $r_str = ref $thingy ? $thingy : \$thingy;
     _init_e2u();
@@ -84,21 +84,21 @@
     $$r_str;
 }

-sub Jcode::euc_utf8{
+sub Jcode::_Classic::euc_utf8{
     my $thingy = shift;
     my $r_str = ref $thingy ? $thingy : \$thingy;
-    &Jcode::euc_ucs2($r_str);
-    &Jcode::ucs2_utf8($r_str);
+    &Jcode::_Classic::euc_ucs2($r_str);
+    &Jcode::_Classic::ucs2_utf8($r_str);
 }

-sub Jcode::utf8_euc{
+sub Jcode::_Classic::utf8_euc{
     my $thingy = shift;
     my $r_str = ref $thingy ? $thingy : \$thingy;
-    &Jcode::utf8_ucs2($r_str);
-    &Jcode::ucs2_euc($r_str);
+    &Jcode::_Classic::utf8_ucs2($r_str);
+    &Jcode::_Classic::ucs2_euc($r_str);
 }

-sub Jcode::ucs2_utf8{
+sub Jcode::_Classic::ucs2_utf8{
     my $thingy = shift;
     my $r_str = ref $thingy ? $thingy : \$thingy;
     my $result;
@@ -121,7 +121,7 @@
     $$r_str = $result;
 }

-sub Jcode::utf8_ucs2{
+sub Jcode::_Classic::utf8_ucs2{
     my $thingy = shift;
     my $r_str = ref $thingy ? $thingy : \$thingy;
     my $result;

とりあえず、動いてそげ。

2007/06/21

はてな
このサイトのfeedは、Feedburnerを使って焼いていません。いずれdel.icio.us等と一緒に配信させて頂くことになるやもしれませんが、なんとなくブログのフィード購読者数をカウントするCGI作ってみました。
例によって2〜3分で出来た代物なので(ブログ書いてる時間のほうが長いやろ)、中身のクオリティは適当です。
大体の著明なFeed-Fetcherは、ユーザエージェントに「XXX subscriber」という文字列を埋め込んできます。このXXXにそのフィードリーダのsubscriber数が格納されています。
blosxomのloggerプラグイン(もしくはココ)が出力したログファイルから、このsubscriber部を抜き取り著明なフィードリーダ毎購読者数をカウントします。

livedoor FeedFetcher/0.01 (http://reader.livedoor.com/; 23 subscribers) ...
#!/usr/bin/perl

use strict;
my $logfile = "/blosxom/logs/access.log";
#my $logfile = "access.log";
my %agents;
my %bot_ua = (
  'Hatena' => 'Hatena\x20RSS',
  'NewsAlloy' => 'NewsAlloy',
  'FreshReader' => 'FreshReader',
  'Feedpath' => 'Feedpath',
  'Google Reader' => 'Feedfetcher-Google',
  'Rojo' => 'Rojo',
  'Bloglines' => 'Bloglines',
  'Livedoor Reader' => 'livedoor\x20FeedFetcher',
);
open(FILE, "<$logfile");
while(<FILE>) {
  my $line = $_;
  $line =~ s/^([^\t]+\t){2}([^\t]+)\t.*/\2/;
  if ((my $ua) = grep {$line =~ /$bot_ua{$_}/} keys(%bot_ua)) {
    $line =~ s/^.* ([0-9]+) subscriber.*\n$/\1/;
    $agents{$ua} = $line if ($agents{$ua} < $line);
  }
}
close(FILE);

print <<EOF
Content-Type: text/html;

<html>
<head><title>Your Feeds Subscriber</title><head>
<body>
<table border=\"1\">
EOF
;
my $sum = 0;
while(my ($key, $value) = each(%agents)) {
  print "<tr><td>$key</td><td>$value</td></tr>\n";
  $sum += $value;
}
print <<EOF
<tr><td>total</td><td>$sum</td></tr>
</table>
</body>
</html>
EOF
;

いや、つまらない事しか書いてないのに、購読者がいらっしゃるとは...
※実際にはクライアントサイドで閲覧していらしゃるでしょうから、正しい値とは限りません。

新規投稿