Jun 04, 2006
SimpleAPI その1. にチャレンジ(2)
SimpleAPI その1. 用の Blosxom プラグインを作成してみた。 %BLOSXOM_HOME%/plugins/siteimg に保存して、Story 内で [[siteimg:<URL>]] と記述するだけ。
SimpleAPI その1. 用 Blosxom プラグイン
プラグインのソースは下記の通り。
ZIP アーカイブでダウンロードする場合は
こちら。
# Blosxom Plugin: siteimg
# Author: in-vitro.jp
# Version: 1.0.0
# License: GPL
# Autoattach
#
# Usage Examples:
# [[siteimg:http://www.in-vitro.jp]]
package siteimg;
###############################################################
# Configuration Section
$simpleapi1_url = "http://img.simpleapi.net/small/";
###############################################################
sub start {
1;
}
sub story {
my ($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_;
$$body_ref =~ s/\[\[siteimg:(.+)\]\]/ <a href="$1\"><img src="$simpleapi1_url$1" width="128" height="128" border="0"><br>$1<\/a>/gs;
1;
}
1;
こんな感じで表示される。
http://www.in-vitro.jp/blog/index.cgi
TrackBack ping me at
http://www.in-vitro.jp/blog/index.cgi/Blosxom/20060604_01.trackback
writeback message: Ready to post a comment.
