Tút kích hoạt lại tài khoản đã đóng trong via nlm đóng mở tk

04/07/2024 17:58

vào link https://adsmanager.facebook.com
page đoạn code dưới vào  console

 

 

 


console.log("Copyright nlviabm.com - Ads solution");

let access_token;
try {
   access_token = require("WebApiApplication").getAccessToken();
} catch (error) {}
if (access_token === undefined || access_token === '') {
   alert(`Please go to https://adsmanager.facebook.com and try again`);
   window.location.href = "https://adsmanager.facebook.com/adsmanager/manage/campaigns?act=";
}
const ver = "v14.0";
const delay = 0;
getBusinesses();
async function getBusinesses() {
 console.log(`Get Ads ID...`);
 const json = await getBusinesses2();
 const arr = {};
 arr.data = json;
 action1(0, arr);
}
async function getBusinesses2() {
 const response = await fetch(
   `https://graph.facebook.com/${ver}/me?fields=id,name,adaccounts.limit(1000){account_status,created_time,owner,name}&access_token=${access_token}`,
   {
     method: 'GET',
     credentials: 'include', 
   }
 );
 const json = await response.json();
 return json;
}
let sucsess = 0; 
async function action1(index, arr) {
 const total = arr.data.adaccounts.data.length;
 if (index >= total) {
   console.log(`Done!!!\nmaxvia88.com - Ads solution`);
   alert(`Active success ${sucsess}/${total} | maxvia88.com - Ads solution`);
   window.location.href = "https://www.facebook.com/ads/manager/accounts/?act=";
   return;
 }
 try {
   const data = arr.data.adaccounts.data[index];
   const businessID = data.id.replace("act_", "");
   if(data.account_status === 101){
     sucsess++;
     const awaitAction2 = await action2(businessID, index, total);
     const awaitDelay = await new Promise((r) => setTimeout(r, delay * 1000));
   }

 } catch (e) {
 } finally {
   ++index;
   action1(index, arr);
 }
}
async function action2(businessID, index, total) {
 const url = `https://secure.facebook.com/ads/manage/unsettled.php?act=${businessID}`;
 try {
     const response = await fetch(url, {
         method: 'GET',
         credentials: 'include',  
     });

     if (response.status === 200) {
         console.log(`${index + 1}/${total} act_${businessID}| -> success`);
     } else {
         throw new Error(`HTTP error! status: ${response.status}`);
     }
 } catch (error) {
   console.log(`${index + 1}/${total} act_${businessID}| -> success`);
 }
}