-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
Its really great
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"eslint.enable": false, | ||
"tslint.enable": false | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
var myArgs = require('optimist').argv, | ||
help = 'Input what you want to translate'; | ||
var MsTranslator = require('mstranslator'); | ||
var request = require("request"); | ||
var body; | ||
|
||
var client = new MsTranslator({ | ||
api_key: "d2cad78206ae43ac9a179ae4315170f3" | ||
}, true); | ||
|
||
if ((myArgs.h)||(myArgs.help)) { | ||
console.log(help); | ||
process.exit(0); | ||
} | ||
|
||
switch (myArgs._[0]) { | ||
case 'translate': | ||
break; | ||
default: | ||
|
||
} | ||
|
||
console.log('myArgs: ', myArgs); | ||
|
||
|
||
|
||
|
||
|
||
var web = request({ | ||
uri: "https://docs.oracle.com/javase/tutorial/", | ||
}, function(error, response, data) { | ||
body = data; | ||
|
||
var params = { | ||
text: myArgs._[1] | ||
, from: 'en' | ||
, to: 'es' | ||
, contentType: 'text/html' | ||
}; | ||
//console.log(JSON.stringify(body)); | ||
// Don't worry about access token, it will be auto-generated if needed. | ||
client.translate(params, function(err, data) { | ||
console.log(data); | ||
}); | ||
|
||
|
||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.