Skip to content

Commit

Permalink
remove proxy and fix google-translate-token
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalets committed Oct 1, 2018
1 parent ed152ef commit f1e2849
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 109 deletions.
84 changes: 13 additions & 71 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,13 @@
"cheerio": "^1.0.0-rc.2",
"emoji-regex": "^6.5.1",
"fs-extra": "^5.0.0",
"global-tunnel-ng": "^2.6.0",
"google-translate-api": "github:vitalets/google-translate-api",
"google-translate-token": "github:vitalets/google-translate-token",
"ip": "^1.1.5",
"ms": "^2.1.1",
"parse-link-header": "^1.0.1",
"promise-retry": "^1.1.1",
"ramda": "^0.25.0",
"tunnel": "0.0.6"
"ramda": "^0.25.0"
},
"devDependencies": {
"chai": "^4.1.2",
Expand Down
31 changes: 0 additions & 31 deletions scripts/helpers/proxy.js

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/helpers/translator.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
const translate = require('google-translate-api');
const emojiRegex = require('emoji-regex');
const {logError, log} = require('./logger');
const proxy = require('./proxy');

const ONLY_LATIN_SYMBOLS = /^[\u0000-\u007F]*$/; // eslint-disable-line no-control-regex
const EMOJI = emojiRegex();
Expand Down Expand Up @@ -45,12 +44,9 @@ module.exports = class Translator {

async _translate() {
try {
// use proxy to access translate api
await proxy.enable();
this._result = await translate(this._text, {to: 'en'});
} catch (e) {
logError(e);
}
proxy.disable();
}
};

0 comments on commit f1e2849

Please sign in to comment.