From 72f72d64a422d6628c4796f5c0bf2e508f134214 Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Wed, 4 May 2011 16:05:14 +0900 Subject: Adding upstream version 0.5.1 --- Bonus/goodict.cgi | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 Bonus/goodict.cgi (limited to 'Bonus/goodict.cgi') diff --git a/Bonus/goodict.cgi b/Bonus/goodict.cgi new file mode 100755 index 0000000..8f443c1 --- /dev/null +++ b/Bonus/goodict.cgi @@ -0,0 +1,38 @@ +#!/usr/bin/perl + +# ~/.w3m/urimethodmap +# e: file:/cgi-bin/goodict.cgi?%s +# w: file:/cgi-bin/goodict.cgi?%s +# j: file:/cgi-bin/goodict.cgi?%s + +use NKF; +#$mode = 0; # substring +$mode = 1; # perfect match +#$mode = 3; # search body text +$url = "http://dictionary.goo.ne.jp"; +$_ = $ENV{"QUERY_STRING"}; +if (/^e:/) { + $kind = 'ej'; +} elsif (/^w:/) { + $kind = 'je'; +} elsif (/^j:/) { + $kind = 'jn'; +} +s@^[ewjs]:@@ && s@^//@@ && s@/$@@; +if ($_) { + s/\+/ /g; + s/%([\da-f][\da-f])/pack('C', hex($1))/egi; + $_ = nkf("-e", $_); + s/[\000-\040\+:#?&%<>"\177-\377]/sprintf('%%%02X', unpack('C', $&))/eg; + $url .= "/search.php?MT=$_&kind=$kind&mode=$mode"; +} else { + $input = "w3m-control: GOTO_LINK"; +} +print < Date: Sat, 2 Jan 2021 09:20:37 +0900 Subject: New upstream version 0.5.3+git20210102 --- Bonus/goodict.cgi | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) (limited to 'Bonus/goodict.cgi') diff --git a/Bonus/goodict.cgi b/Bonus/goodict.cgi index 8f443c1..5fb6581 100755 --- a/Bonus/goodict.cgi +++ b/Bonus/goodict.cgi @@ -1,14 +1,20 @@ #!/usr/bin/perl # ~/.w3m/urimethodmap -# e: file:/cgi-bin/goodict.cgi?%s -# w: file:/cgi-bin/goodict.cgi?%s -# j: file:/cgi-bin/goodict.cgi?%s +# e: file:/cgi-bin/goodict.cgi?%s Englich-Japanese +# w: file:/cgi-bin/goodict.cgi?%s Japanese-English +# j: file:/cgi-bin/goodict.cgi?%s Japanese +# a: file:/cgi-bin/goodict.cgi?%s All +# +# e:0:word start with word +# e:1:word perfect match +# e:2:word end with word +# e:3:word search body text +# e:6:word search title +# e:word perfect match -use NKF; -#$mode = 0; # substring -$mode = 1; # perfect match -#$mode = 3; # search body text +use Encode; +use Encode::Guess qw/euc-jp utf8/; $url = "http://dictionary.goo.ne.jp"; $_ = $ENV{"QUERY_STRING"}; if (/^e:/) { @@ -17,14 +23,22 @@ if (/^e:/) { $kind = 'je'; } elsif (/^j:/) { $kind = 'jn'; +} elsif (/^a:/) { + $kind = 'all' +} +s@^[ewja]:@@ && s@^//@@ && s@/$@@; +if (/^([01236]):/) { + $mode=$1; + s/^[01236]://; +}else{ + $mode="1"; } -s@^[ewjs]:@@ && s@^//@@ && s@/$@@; if ($_) { s/\+/ /g; s/%([\da-f][\da-f])/pack('C', hex($1))/egi; - $_ = nkf("-e", $_); + $_ = encode("utf8", decode("Guess", $_)); s/[\000-\040\+:#?&%<>"\177-\377]/sprintf('%%%02X', unpack('C', $&))/eg; - $url .= "/search.php?MT=$_&kind=$kind&mode=$mode"; + $url .= "/srch/$kind/$_/m$mode"."u/"; } else { $input = "w3m-control: GOTO_LINK"; } -- cgit v1.2.3