This repository was archived by the owner on Jun 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.js
More file actions
54 lines (43 loc) · 2.53 KB
/
Copy pathscript.js
File metadata and controls
54 lines (43 loc) · 2.53 KB
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 tableBody = document.getElementById("data-body");
function loadData() {
fetch("https://free-domains.github.io/raw", {
method: "GET"
}).then(res => res.json()).then(data => {
data.sort((a, b) => `${a.subdomain}.${a.domain}`.localeCompare(`${b.subdomain}.${b.domain}`));
data.forEach(i => {
let row = tableBody.insertRow(-1);
let c1 = row.insertCell(0);
let c2 = row.insertCell(1);
let c3 = row.insertCell(2);
let c4 = row.insertCell(3);
c1.classList = "px-4 py-2 outline outline-1 outline-gray-700";
c2.classList = "px-4 py-2 outline outline-1 outline-gray-700";
c3.classList = "px-4 py-2 outline outline-1 outline-gray-700";
c4.classList = "px-4 py-2 outline outline-1 outline-gray-700 text-center";
const records = [];
Object.keys(i.records).forEach(record => {
if(record === "A" || record === "AAAA") {
return i.records[record].forEach(r => {
records.push(`<span class="text-blue-600 font-semibold">${record}</span> ${r}`);
})
}
if(record === "MX") {
return i.records[record].forEach(r => {
records.push(`<span class="text-blue-600 font-semibold">${record}</span> <span class="text-green-600 font-semibold">${r.priority}</span> ${r.value.toLowerCase()}`);
})
}
if(record === "TXT") {
return i.records[record].forEach(r => {
records.push(`<span class="text-blue-600 font-semibold">${record}</span> <span class="text-green-600 font-semibold">${r.name}</span> ${r.value}`);
})
}
records.push(`<span class="text-blue-600 font-semibold">${record}</span> ${i.records[record].toLowerCase()}`);
})
c1.innerHTML = `<a href="https://${i.subdomain}.${i.domain}" class="text-blue-500 hover:text-blue-600 font-semibold">${i.subdomain}.${i.domain}</a>`;
c2.innerHTML = `<a href="mailto:${i.owner.email.replace(" (at) ", "@")}" class="underline underline-2 hover:no-underline">${i.owner.email.replace(" (at) ", "@")}</a>`;
c3.innerHTML = records.join("<br>");
c4.innerHTML = `<i class="${i.proxied ? "fa-solid fa-check text-green-600" : "fa-solid fa-x text-red-600"}"></i>`;
})
})
}
loadData();