From: Jacob Fugal Date: 2005-12-15T06:47:08+09:00 Subject: Re: English Ruby Home as a second class citizen On 12/14/05, Wilson Bilkovich wrote: > Does this lame little snippet help? Heh. Unfortunately, babelfish is > limited to 150 words. > Also, ruby-lang.org/ja uses EUC encoding, so if you're grabbing it > directly, rather than in Unicode form, you'll want $KCODE="E" > > #jp.rb > require 'open-uri' > require 'cgi' > $KCODE="u" > exit unless ARGV[0] > input = CGI.escape(ARGV[0]) > trans = URI("http://babelfish.altavista.com/tr?doit=done&intl=1&tt=urltext&trtext=#{input}&lp=ja_en&btnTrTxt=Translate").read > output = trans[/
(.*)<\/div>/, 1] > puts output I tried integrating that, but the 150 char limit meant that most -- if not all -- of the bodies couldn't be translated. Having translated titles would be a slight improvement, but not enough. Thanks for the direction though! Jacob Fugal