Recently, Google Translate has evolved using a neural network.
So I created an original API server that uses Google Translate without using the API.
I slack off this now and so handle only from Japanese to English, but it can also correspond easily to other languages.
It’s very easy to use.
$ git clone https://github.com/saitoxu/honyaku-konnyaku-server.git $ cd honyaku-konnyaku-server $ npm install $ npm run server # another shell $ curl http://localhost:1337?text=%E3%81%93%E3%82%93%E3%81%AB%E3%82%83%E3%81%8F Konjac
Mechanism is as below.
- When receiving a request, access to the Google Translate page by PhantomJS
- Retrieve translation result with HTML parser, Cheerio
- Return the result to the client
Because we get the full source of the Google Translate page, the response is not fast.
So we can’t use this in production environment, but please try using it as a joke.