-
-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathfb_getTokenFacebook.js
64 lines (61 loc) · 2.15 KB
/
fb_getTokenFacebook.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
56
57
58
59
60
61
62
63
64
import { BADGES } from "./helpers/badge.js";
export default {
icon: `<i class="fa-solid fa-key fa-lg"></i>`,
name: {
en: "Get fb token EAAB (instagram)",
vi: "Lấy fb token EAAB (instagram)",
},
description: {
en: "Get facebook access token EAAB from www.facebook.com",
vi: "Lấy facebook access token EAAB từ trang www.facebook.com",
},
badges: [BADGES.hot],
whiteList: ["https://*.facebook.com/*"],
pageScript: {
onClick: function () {
try {
let uid = /(?<=c_user=)(\d+)/.exec(document.cookie)?.[0];
if (!uid) {
alert("Không tìm thấy uid trong cookie. Bạn đã đăng nhập chưa?");
return;
}
let dtsg =
require("DTSGInitialData").token ||
document.querySelector('[name="fb_dtsg"]').value,
xhr = new XMLHttpRequest(),
url = "//www.facebook.com/v1.0/dialog/oauth/confirm",
params =
"fb_dtsg=" +
dtsg +
"&app_id=124024574287414&redirect_uri=fbconnect%3A%2F%2Fsuccess&display=page&access_token=&from_post=1&return_format=access_token&domain=&sso_device=ios&_CONFIRM=1&_user=" +
uid;
xhr.open("POST", url, !0);
xhr.setRequestHeader(
"Content-type",
"application/x-www-form-urlencoded"
);
xhr.onreadystatechange = function () {
if (4 == xhr.readyState && 200 == xhr.status) {
var a = xhr.responseText.match(/(?<=access_token=)(.*?)(?=\&)/);
console.log(xhr.responseText);
if (a && a[0]) {
prompt("Token", a[0]);
} else {
alert("Failed to Get Access Token.");
}
}
};
xhr.onerror = function () {
alert("Failed to Get Access Token.");
};
xhr.send(params);
} catch (e) {
alert("ERROR: " + e);
}
},
},
};
function backup() {
// https://isharevn.net/chia-se-cach-get-token-facebook-update-time.html
// view-source:https://www.facebook.com/dialog/oauth?client_id=124024574287414&redirect_uri=https://www.instagram.com/accounts/signup/&&scope=email&response_type=token
}