-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
87 lines (77 loc) · 2.91 KB
/
script.js
File metadata and controls
87 lines (77 loc) · 2.91 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
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
86
87
document.getElementById("themeToggle").addEventListener("click", () => {
document.body.classList.toggle("light");
});
function checkUIDs() {
const input = document.getElementById("uidInput").value.trim().split("\n");
const aliveList = document.getElementById("aliveList");
const deadList = document.getElementById("deadList");
const loader = document.getElementById("loader");
aliveList.innerHTML = "";
deadList.innerHTML = "";
document.getElementById("aliveCount").textContent = "0";
document.getElementById("deadCount").textContent = "0";
loader.classList.remove("hidden");
let alive = [];
let dead = [];
let processed = 0;
input.forEach(uid => {
const url = `https://graph.facebook.com/${uid}/picture?type=normal`;
fetch(url)
.then(res => res.text())
.then(text => {
if (text.includes("Photoshop")) {
alive.push(uid);
} else {
dead.push(uid);
}
})
.catch(() => {
dead.push(uid);
})
.finally(() => {
processed++;
if (processed === input.length) {
alive.forEach(id => {
const li = document.createElement("li");
li.textContent = id;
aliveList.appendChild(li);
});
dead.forEach(id => {
const li = document.createElement("li");
li.textContent = id;
deadList.appendChild(li);
});
document.getElementById("aliveCount").textContent = alive.length;
document.getElementById("deadCount").textContent = dead.length;
loader.classList.add("hidden");
}
});
});
}
function copyToClipboard(listId) {
const list = document.getElementById(listId);
const items = Array.from(list.querySelectorAll("li")).map(li => li.textContent.trim());
const text = items.join("\n");
navigator.clipboard.writeText(text).then(() => {
alert("Copied to clipboard!");
});
}
const languageSelect = document.getElementById("languageSelect");
const languages = [
"English", "Spanish", "French", "German", "Italian", "Portuguese", "Russian", "Chinese", "Japanese",
"Korean", "Hindi", "Arabic", "Bengali", "Dutch", "Greek", "Hebrew", "Indonesian", "Malay", "Polish",
"Romanian", "Swedish", "Thai", "Turkish", "Ukrainian", "Vietnamese", "Czech", "Danish", "Finnish",
"Hungarian", "Norwegian", "Slovak", "Slovenian", "Filipino", "Persian", "Swahili", "Tamil", "Telugu",
"Urdu", "Bulgarian", "Croatian", "Estonian", "Latvian", "Lithuanian", "Serbian", "Afrikaans", "Zulu",
"Catalan", "Icelandic", "Mongolian", "Pashto", "Punjabi"
];
languages.forEach(lang => {
const option = document.createElement("option");
option.value = lang.toLowerCase();
option.textContent = lang;
languageSelect.appendChild(option);
});
languageSelect.addEventListener("change", () => {
const selected = languageSelect.value;
alert("Auto-translation to " + selected + " is not active in demo.");
});