forked from lovmoon3k/useful-script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfb_getAllUidFromFriendsPage.js
55 lines (49 loc) · 1.65 KB
/
fb_getAllUidFromFriendsPage.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
export default {
name: {
en: "Get all fb User ID from Friends page",
vi: "Lấy tất cả fb user id từ danh sách bạn bè",
},
description: {
en: "Get id of all user from friends page",
vi: "Lấy tất cả user ID từ trang danh sách bạn bè",
},
blackList: [],
whiteList: ["*://www.facebook.com"],
func: async function () {
// Lấy tất cả uid từ trang facebook search bạn bè
// Ví dụ: https://www.facebook.com/search/people/?q=*a&epa=FILTERS&filters=eyJmcmllbmRzIjoie1wibmFtZVwiOlwidXNlcnNfZnJpZW5kc19vZl9wZW9wbGVcIixcImFyZ3NcIjpcIjEwMDA2NDI2NzYzMjI0MlwifSJ9
// Link trên được tạo từ web: https://sowsearch.info/
const _getUidFromUrl = 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;
};
alert("Đang lấy thông tin uid, mở console để xem tiến trình...");
let list_a = Array.from(
document.querySelectorAll(".sjgh65i0 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 _getUidFromUrl(l);
uids.push(uid);
console.log(name, uid);
}
console.log(uids);
window.prompt("Tất cả UID: ", uids.join("\n"));
},
};
export async function getAllUidFromFriendsPage() {}