forked from lovmoon3k/useful-script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfb_getAllUidFromFbSearch.js
49 lines (48 loc) · 1.35 KB
/
fb_getAllUidFromFbSearch.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
export default {
name: {
en: "Get all fb User ID from search page",
vi: "Lấy tất cả fb user ID từ trang tìm kiếm",
},
description: {
en: "Get id of all user from fb search page",
vi: "Lấy id của tất cả user từ trang tìm kiếm người dùng",
},
blackList: [],
whiteList: ["*://www.facebook.com"],
func: function () {
const getUid = async (url) => {
var response = await fetch(url);
if (response.status == 200) {
var text = await response.text();
let uid = /(?<=\"userID\"\:\")(.\d+?)(?=\")/.exec(text);
if (uid?.length) {
return uid[0];
}
}
return null;
};
const main = async () => {
alert("Đang lấy thông tin uid, mở console để xem tiến trình...");
let list_a = Array.from(
document.querySelectorAll("a[role='presentation']")
);
let uids = [];
for (let a of list_a) {
let l = a.href;
let uid = l.split("profile.php?id=")[1];
if (uid) {
uids.push(uid);
console.log(uid);
continue;
}
let name = l.split("facebook.com/")[1];
uid = await getUid(l);
uids.push(uid);
console.log(name, uid);
}
console.log(uids);
window.prompt("Tất cả UID: ", uids.join("\n"));
};
main();
},
};