This repository has been archived by the owner on May 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathindex.js
85 lines (80 loc) · 2.04 KB
/
index.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
79
80
81
82
83
84
85
const { prompt } = require("enquirer");
var clc = require("cli-color");
const {
ERR_DOMAIN,
BANNER,
QUESTION,
VALIDATOR,
INPUT,
CAPTION,
FAQ,
} = require("./lib/constant");
const { getAPI } = require("./lib/getAPI");
const { getBacklink } = require("./lib/getBacklink");
const { checkLinks } = require("./lib/checkLink");
const { HTTPRefer } = require("./lib/HTTPRefer");
const {getMoz} = require("./lib/getMoz");
const cliSpinners = require("cli-spinners");
const Spinners = require("spinnies");
const spinners = new Spinners({
spinnerColor: "blueBright",
succeedColor: "greenBright",
failColor: "redBright",
spinner: cliSpinners.dots,
});
const question = [
{
type: "input",
name: INPUT,
message: QUESTION,
validator: VALIDATOR,
warning: ERR_DOMAIN,
},
];
console.log(
clc.greenBright(BANNER) +
"\n" +
clc.blueBright(CAPTION) +
"\n" +
clc.yellowBright(FAQ) +
"\n"
);
(async function startApp() {
const { [INPUT]: domain } = await prompt(question);
console.log(clc.whiteBright("\n"));
const data = await getAPI();
for (let i = 0; i < data.length; i++) {
const link = getBacklink(data[i]);
const res = await checkLinks(link, domain);
spinners.add("success", {
text: "[+] Starting [+]",
color: "green",
});
switch (res) {
case 200:
await HTTPRefer(link, domain);
const [mozdata] = await getMoz(link);
let succes = "[+] " + link + domain + " [200]" + " | Moz Rank => [DA] "+ mozdata.da +" [PA]"+mozdata.da;
spinners.update("success", {
text: succes,
color: "green",
});
break;
case 404:
let notfound = "[-] " + link + domain + " [404]";
spinners.add("err", {
text: notfound,
color: "red",
});
spinners.update("err", {
text: notfound,
color: "red",
});
break;
default:
let unknown = "[?] " + link + domain + " [Unknown]";
console.log(clc.whiteBright(unknown));
break;
}
}
})();