# -*-perl-*-
# keitairc/lib/plugins/31distinct
# 
# ̾ϤޤʸGoogle Map˥
# TODO: Ԥζ褷ϤäƤʤ
# $Id: 31distinct,v 1.1 2008/01/14 05:22:44 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 . ')(.*)',
	message_replace_imprementation => sub {
		my ($session_id, $p1, $p2) = @_;
		my $str = $p1 . $p2;
		my $tmp = $str;
		Encode::from_to($tmp, 'euc-jp', 'shiftjis');
		my $tmp = ::uri_escape($tmp);
		sprintf('<a href="http://www.google.co.jp/m/lcb?mp=1&uipref=3&source=m&ie=Shift_JIS&action=chgloc&loc=%s">%s</a>', $tmp, $str);
	},
};

1;


