Skip to content

Commit

Permalink
✨Feature:Significantly reduce the package size.
Browse files Browse the repository at this point in the history
  • Loading branch information
DarinRowe committed May 8, 2020
1 parent b758252 commit ae6f476
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

### 0.2.3 (May 8, 2020)

- Support "zh-hk" language.
- Support "zh-hk" & "Filipino" & "zh-sg" language.
- Supplement README.md.
- Significantly reduce the package size.

### 0.2.2 (May 5, 2020)

Expand Down
1 change: 0 additions & 1 deletion config/userAgents.json

This file was deleted.

2 changes: 2 additions & 0 deletions src/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const langs = {
ny: "Chichewa",
zh: "Chinese (Simplified)",
"zh-cn": "Chinese (Simplified)",
"zh-sg": "Chinese (Simplified)",
"zh-tw": "Chinese (Traditional)",
"zh-hk": "Chinese (Traditional)",
co: "Corsican",
Expand Down Expand Up @@ -112,6 +113,7 @@ const langs = {
yi: "Yiddish",
yo: "Yoruba",
zu: "Zulu",
fil: "Filipino",
};

/**
Expand Down
1 change: 1 addition & 0 deletions src/tempCodeRunnerFile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

6 changes: 3 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const agentFile = require("../config/userAgents.json");
const agentFile = require("../uas/userAgents.json");

/**
* Generating a Random User Agent
* @return {String} - User Agent string
*/
function getUserAgent() {
// const agentFile = fs.readFileSync("../config/userAgents.json");
const browsers = JSON.parse(agentFile)["browsers"];
// const agentFile = fs.readFileSync("../uas/userAgents.json");
const browsers = agentFile["browsers"];
const browsersKeys = Object.keys(browsers);
const browserNmb = getRandom(0, browsersKeys.length - 1);
const browsersKey = browsersKeys[browserNmb];
Expand Down
1 change: 1 addition & 0 deletions uas/userAgents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"browsers":{"chrome":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36","Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36","Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.93 Safari/537.36","Mozilla/5.0 (X11; OpenBSD i386) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36","Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.517 Safari/537.36","Mozilla/5.0 (X11; CrOS i686 4319.74.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36","Mozilla/5.0 (X11; NetBSD) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36"],"opera":["Opera/9.80 (X11; Linux i686; Ubuntu/14.10) Presto/2.12.388 Version/12.16","Opera/9.80 (Windows NT 6.1; U; es-ES) Presto/2.9.181 Version/12.00","Opera/9.80 (Windows NT 5.1; U; en) Presto/2.9.168 Version/11.51","Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; de) Opera 11.51","Opera/9.80 (X11; Linux x86_64; U; fr) Presto/2.9.168 Version/11.50","Opera/9.80 (X11; Linux i686; U; hu) Presto/2.9.168 Version/11.50","Mozilla/5.0 (Windows NT 5.1; U; en; rv:1.8.1) Gecko/20061208 Firefox/5.0 Opera 11.11","Opera/9.80 (X11; Linux x86_64; U; bg) Presto/2.8.131 Version/11.10","Opera/9.80 (X11; Linux i686; U; ja) Presto/2.7.62 Version/11.01","Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; de) Opera 11.01","Opera/9.80 (Windows NT 6.1; U; zh-cn) Presto/2.6.37 Version/11.00"],"firefox":["Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10; rv:33.0) Gecko/20100101 Firefox/33.0","Mozilla/5.0 (X11; Linux i586; rv:31.0) Gecko/20100101 Firefox/31.0","Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20130331 Firefox/21.0","Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0","Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:17.0) Gecko/20100101 Firefox/17.0.6"],"internetexplorer":["Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; AS; rv:11.0) like Gecko","Mozilla/5.0 (compatible, MSIE 11, Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko","Mozilla/5.0 (compatible; MSIE 10.6; Windows NT 6.1; Trident/5.0; InfoPath.2; SLCC1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 2.0.50727) 3gpp-gba UNTRUSTED/1.0","Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 7.0; InfoPath.3; .NET CLR 3.1.40767; Trident/6.0; en-IN)"],"safari":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A","Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.55.3 (KHTML, like Gecko) Version/5.1.3 Safari/534.53.10","Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko ) Version/5.1 Mobile/9B176 Safari/7534.48.3","Mozilla/5.0 (Windows; U; Windows NT 6.1; tr-TR) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27","Mozilla/5.0 (Windows; U; Windows NT 6.1; ko-KR) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27","Mozilla/5.0 (Windows; U; Windows NT 6.1; fr-FR) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27"]}}

0 comments on commit ae6f476

Please sign in to comment.