# -*-perl-*-
# keitairc/lib/plugins/31distinct
# 
# ̾ϤޤʸGoogle Map˥
# TODO: Ԥζ褷ϤäƤʤ
# $Id: 31distinct,v 1.2 2008/02/25 18:09:22 morimoto Exp $
# $Source: /cvsroot/keitairc/lib/plugins/31distinct,v $


my $tokyo_special_wards = 'Ķ|||ɶ|ʸ||Ķ|||ܹ|Ķ|ë|ë||¶|˭|̶||Ķ|϶|­Ω||';
my $tokyo_cities = '|||߻||Ω||ʬ|ʿ||Ω|¿|Ĵۻ||Ȭһ|¼|αƻ|¼|»|||ʡ|ĮĻ||¢|¢¼';

$plugin = {
	name => 'distinct',

	message_replace_regexp => '((?:' . $tokyo_special_wards . '|' . $tokyo_cities . ')(?:.+)(?:[1-9]||||||ϻ||Ȭ||||Į||))',
	message_replace_imprementation => sub {
		my ($session_id, $str) = @_;
		my $tmp = $str;
		Encode::from_to($tmp, 'euc-jp', 'shiftjis');
		my $tmp = ::uri_escape($tmp);
		return sprintf('<a href="%s%s/address/%s">%s</a>',
			       $::cf->web_root(), $session_id, $tmp, $str);
	},
};

1;


