Traduz textos usando o google

Traduz palavras/frases/textos usando a API do Google, usei aqui http://github.com/rafaelss/shoes-translator
require 'rest_client'
require 'json'
require 'cgi'

word = CGI.escape("hello world")
response = RestClient.get "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=#{word}&langpair=en%7Cpt"
json = JSON.parse(response)
status = json['responseStatus']
if status == 200
    puts json['responseData']['translatedText']
else
    puts "(#{responseStatus}) erro ao traduzir #{word}"
end
Displaying 1 Code