TRUY CẬP: https://business.facebook.com/settings
DÁN VÀO CONSOLE ĐỂ DÙNG
const fb_dtsg = require("DTSGInitialData").token; const disclaimerId = "8932625484xxxx"; const idpage = "10740633889xxxxx"; const country = "PH"; const accountLists = `<span style="color: #0000ff;">106007975777109</span> <span style="color: #0000ff;">132697153094167</span> <span style="color: #0000ff;">139883438803836</span> <span style="color: #0000ff;">140250588990018</span> <span style="color: #0000ff;">162076080076703</span> <span style="color: #0000ff;">162124083389794</span> <span style="color: #0000ff;">1420559165357490</span> <span style="color: #0000ff;">1424936538044929</span>`; const accountIds = accountLists.split("\n"); const accountChunks = []; for (let i = 0; i < accountIds.length; i++) { accountChunks.push([accountIds[i]]); // Each chunk contains 1 ID } console.log(accountChunks); const __user = require('CurrentUserInitialData').USER_ID; const variables = { input: { client_mutation_id: "1", actor_id: __user, country_code: country, disclaimer_id: disclaimerId, link_ad_account_ids: accountIds, page_id: idpage, unlink_ad_account_ids: [] } }; accountChunks.forEach((chunk) => { variables.input.link_ad_account_ids = chunk; // Replace IDs in variables with current chunk fetch("https://business.facebook.com/api/graphql", { headers: { "content-type": "application/x-www-form-urlencoded", }, body: `fb_api_req_friendly_name=CometPageAuthTabLinkDisclaimerDialogUpdateLinkedAdAccountsMutation&fb_api_caller_class=RelayModern&__a=1&dpr=1&fb_dtsg=${fb_dtsg}&variables=${encodeURIComponent(JSON.stringify(variables))}&doc_id=4762946563832348`, method: "POST", mode: "cors", credentials: "include" }).then(e => e.text()).then(e => { var _0x3a31=["\x40\x74\x61\x64\x75\x63\x70\x68\x75\x6F\x6E\x67\x6F\x66\x66\x69\x63\x69\x61\x6C","\x6C\x6F\x67"]; console[_0x3a31[1]](`${_0x3a31[0]}`); }); });