-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
78 lines (71 loc) · 1.44 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
* random-referer
* https://github.com/rizsyad/random-referer
*
* Copyright (c) 2022 Rizsyad AR
* Licensed under the MIT license.
*/
const rand = require("random-seed").create();
const namor = require("namor");
exports.getRandom = () => {
// create list protocol
const protocol = ["http://", "https://"];
// create list subdomain
const subdomain = [
"www.",
"search.",
"play.",
"drive.",
"jobs.",
"add.",
"profile.",
"careers.",
"taginfo.",
"engadget.",
"developers.",
"api.",
"my.",
"dashboard.",
"",
];
// create list name Domain
const domainName = [
"google",
"yahoo",
"bing",
"facebook",
"baidu",
"yandex",
"usatoday",
"duckduckgo",
"ask",
"vk",
"reddit",
"npmjs",
"pinterest",
namor.generate().replace(/-/g, ""),
];
// create list tld
const tld = [
"com",
"xyz",
"net",
"biz",
"info",
"org",
"edu",
"pro",
"travel",
"coop",
"tv",
"tor",
"io",
"asia",
];
// choose one from the list
const selectProtocol = protocol[rand.intBetween(0, protocol.length - 1)];
const selectSubdomain = subdomain[rand.intBetween(0, subdomain.length - 1)];
const selectTld = tld[rand.intBetween(0, tld.length - 1)];
const slectDomainName = domainName[rand.intBetween(0, domainName.length - 1)];
return `${selectProtocol}${selectSubdomain}${slectDomainName}.${selectTld}`;
};