-
Notifications
You must be signed in to change notification settings - Fork 0
/
func.js
54 lines (48 loc) · 1.35 KB
/
func.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
const axios=require('axios')
const result = async (link) => {
const {data} = await axios({
method: "post",
url: "https://developers.checkphish.ai/api/neo/scan",
headers: {
"Content-Type": "application/json",
},
data: {
apiKey:
"ag8y3egpb0jwf35dfct2xezq1v28flj4ukne2huupp2wzlifsb0orr1ldllq3epg",
urlInfo: { url: link },
},
});
const id = data.jobID;
// setTimeout(function() {
// }, 10000);
let data2
data2 = await axios({
method: "post",
url: "https://developers.checkphish.ai/api/neo/scan/status",
headers: {
"Content-Type": "application/json",
},
data: {
apiKey:
"ag8y3egpb0jwf35dfct2xezq1v28flj4ukne2huupp2wzlifsb0orr1ldllq3epg",
jobID: id,
},
});
while(data2.data.status === 'PENDING') {
data2 = await axios({
method: "post",
url: "https://developers.checkphish.ai/api/neo/scan/status",
headers: {
"Content-Type": "application/json",
},
data: {
apiKey:
"ag8y3egpb0jwf35dfct2xezq1v28flj4ukne2huupp2wzlifsb0orr1ldllq3epg",
jobID: id,
},
});
}
console.log(data2.data.url)
console.log(data2.data.disposition);
};
module.exports = result