you are in: codestackercodes [RSS]Traduz textos usando o google

Traduz textos usando o google Delicious Email

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

show/hide lines
   1  require 'rest_client'
   2  require 'json'
   3  require 'cgi'
   4  
   5  word = CGI.escape("hello world")
   6  response = RestClient.get "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=#{word}&langpair=en%7Cpt"
   7  json = JSON.parse(response)
   8  status = json['responseStatus']
   9  if status == 200
  10      puts json['responseData']['translatedText']
  11  else
  12      puts "(#{responseStatus}) erro ao traduzir #{word}"
  13  end
created by rafaess — 03 July 2008 — get a short url — tags: api google json rest ruby tradutor embed

Comments

   1  why is christmas so important? do you know the answer?
   2  
   3   my name is carlinhos.
   4   every year i help my mother to adorn the house for christmas day. we buil a litlle stable and a small chritmas tree. but there is a thing i don“t really understand.

gege — 01 December / 13:37


We dont send spam :)

If checked, it's highlights your comment
simple_captcha.jpg
Are you a human? Type the code from the image