Skip to content

Commit 5a0ec68

Browse files
committed
fix get fb uid
1 parent 3ad82c8 commit 5a0ec68

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

scripts/fb_getUid.js

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,33 @@ export default {
1414
func: function () {
1515
// Lấy user id (uid) - khi đang trong tường của người dùng muốn lấy user id. Ví dụ: https://www.facebook.com/callchoulnhe
1616

17-
const found = (r) =>
18-
r && r[0] && window.prompt(`USER ID của ${document.title}:`, r[0]);
17+
const find = (r) => (r ? r[0] : 0);
1918

20-
return (
21-
found(
19+
let uid =
20+
find(
2221
/(?<=\"userID\"\:\")(.\d+?)(?=\")/.exec(
2322
document.querySelector("html").textContent
2423
)
2524
) ||
26-
found(/(?<=\/profile\.php\?id=)(.\d+?)($|(?=&))/.exec(location.href)) ||
25+
find(/(?<=\/profile\.php\?id=)(.\d+?)($|(?=&))/.exec(location.href)) ||
2726
(() => {
2827
for (let a of Array.from(document.querySelectorAll("a"))) {
29-
if (
30-
found(
31-
/(?<=set\=(pb|picfp|ecnf|pob)\.)(.\d+?)($|(?=\.))/.exec(a.href)
32-
)
33-
)
34-
return true;
28+
let _ = find(
29+
/(?<=set\=(pb|picfp|ecnf|pob)\.)(.\d+?)($|(?=\.))/.exec(a.href)
30+
);
31+
if (_) return _;
3532
}
36-
return false;
33+
return 0;
3734
})() ||
38-
found(
35+
find(
3936
/(?<=\"user\"\:\{\"id\"\:\")(.\d+?)(?=\")/.exec(document.body.innerHTML)
40-
) ||
37+
);
38+
39+
if (uid) window.prompt(`USER ID của ${document.title}:`, uid);
40+
else
4141
window.prompt(
4242
"Không tìm thấy USER ID nào trong trang web!\nBạn có đang ở đúng trang profile chưa?\nTrang web Ví dụ: ",
4343
"https://www.facebook.com/callchoulnhe"
44-
)
45-
);
44+
);
4645
},
4746
};

0 commit comments

Comments
 (0)