You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 facebook page",
vi: "Lấy tất cả user ID từ trang danh sách bạn bè facebook",
},
whiteList: ["https://www.facebook.com/*"],
onClick: 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/
//let list_a = Array.from(
// document.querySelectorAll("a[role='presentation']")
//);
// FIX lay ban be hay vao day roi sroll het ban be
// https://www.facebook.com/friends/list
const linkElements = document.querySelectorAll('a.x1i10hfl.x1qjc9v5.xjbqb8w.xjqpnuy.xa49m3k.xqeqjp1.x2hbi6w.x13fuv20.xu3j5b3.x1q0q8m5.x26u7qi.x972fbf.xcfux6l.x1qhh985.xm0m39n.x9f619.x1ypdohk.xdl72j9.x2lah0s.xe8uvvx.xdj266r.x11i5rnm.xat24cr.x1mh8g0r.x2lwn1j.xeuugli.xexx8yu.x4uap5.x18d9i69.xkhd6sd.x1n2onr6.x16tdsg8.x1hl2dhg.xggy1nq.x1ja2u2z.x1t137rt.x1q0g3np.x87ps6o.x1lku1pv.x1a2a7pz.x1lq5wgf.xgqcy7u.x30kzoy.x9jhf4c.x1lliihq');
const linkHrefs = Array.from(linkElements).map(linkElement => linkElement.getAttribute('href'));
console.log(linkHrefs);
let list_a=linkHrefs;
if (!list_a.length) {
return prompt(
"Không tìm thấy thông tin, bạn đã ở đúng trang tìm kiếm bạn bè fb chưa?" +
"\nTrang web ví dụ:",
"https://www.facebook.com/search/people/?q=*a"
);
}
alert("Đang lấy thông tin uid, mở console để xem tiến trình...");
let uids = [];
for (let a of list_a) {
try {
//let l = a.href;
let uid = a.split("profile.php?id=")[1];
if (uid) {
uids.push(uid);
console.log(uid);
continue;
}
let name = l.split("facebook.com/")[1];
uid = await UsefulScriptGlobalPageContext.Facebook.getUidFromUrl(l);
uids.push(uid);
console.log(name, uid);
} catch (e) {
console.log("Lỗi khi lấy thông tin của " + a, e);
}
}
console.log(uids);
prompt("Tất cả UID: ", uids.join("\n"));
},
};
The text was updated successfully, but these errors were encountered:
Chức năng lấy thông tin danh sách bạn bè từ trang bạn bè đã có, còn chức năng này là lấy thông tin users từ trang tìm kiếm, 2 chức năng này khác nhau nhé.
rewrite code
The text was updated successfully, but these errors were encountered: