Skip to content

Instantly share code, notes, and snippets.

@jayremnt
Last active December 2, 2020 01:59
Show Gist options
  • Save jayremnt/c924573842df93aeeed7b958db808074 to your computer and use it in GitHub Desktop.
Save jayremnt/c924573842df93aeeed7b958db808074 to your computer and use it in GitHub Desktop.
/*
Script by JayremntB, 2020
Delete user's posts
Please copy all the code to make sure that you will not get any errors
*/
// process, please don't modify
let accessToken = "";
let postsLimit = 1000000;
let _0x4fde=['\x20bài\x20viết.\x20Vẫn\x20đang\x20load...','POST','stringify','readyState','log','Đã\x20load\x20','responseText','token','/posts','find','then','<-----\x20Số\x20bài\x20viết\x20đã\x20xoá','split','cookie','Error:\x20','data','DONE!','status','parse','https://www.facebook.com/api/graphql/','---------------------------','catch','qpl_active_flow_ids=55246849','c_user','all','paging','append','open','GET','push','PERMALINK','Delete\x20user\x27s\x20posts','length','next','useCometFeedStoryDeleteMutation','forEach','S:_I','undefined'];(function(_0x3964f3,_0x4fde88){let _0x93a754=function(_0x4218a6){while(--_0x4218a6){_0x3964f3['push'](_0x3964f3['shift']());}};_0x93a754(++_0x4fde88);}(_0x4fde,0x19c));let _0x93a7=function(_0x3964f3,_0x4fde88){_0x3964f3=_0x3964f3-0x0;let _0x93a754=_0x4fde[_0x3964f3];return _0x93a754;};let _0x3c721b=_0x93a7;let fbDtsg=require('DTSGInitialData')[_0x3c721b('0xd')],uid=document[_0x3c721b('0x13')][_0x3c721b('0x12')](';')[_0x3c721b('0xf')](_0x4218a6=>_0x4218a6['includes'](_0x3c721b('0x1d')))[_0x3c721b('0x12')]('=')[0x1];(()=>{let _0x54a139=_0x3c721b;console[_0x54a139('0xa')]('Script\x20by\x20JayremntB,\x202020'),console[_0x54a139('0xa')](_0x54a139('0x25')),console[_0x54a139('0xa')](_0x54a139('0x1a')),getPostIDs(uid,postsLimit)[_0x54a139('0x10')](_0xd228e1=>{let _0x3db8de=_0x54a139;let _0xefa680=[];_0xd228e1[_0x3db8de('0x3')](_0x2094c0=>_0xefa680[_0x3db8de('0x23')](deletePost(uid,_0x2094c0))),Promise[_0x3db8de('0x1e')](_0xefa680)['then'](()=>{let _0x1dcb97=_0x3db8de;console[_0x1dcb97('0xa')](_0x1dcb97('0x16'));})[_0x3db8de('0x1b')](_0x20a98a=>console[_0x3db8de('0xa')](_0x20a98a));})[_0x54a139('0x1b')](_0x386b9c=>console[_0x54a139('0xa')](_0x386b9c));})();function getPostIDs(_0xe039e8,_0x30e4b8){return new Promise((_0x3f84e6,_0x151851)=>{let _0x5830ac=_0x93a7;request(_0x5830ac('0x22'),'https://graph.facebook.com/'+_0xe039e8+_0x5830ac('0xe'),{'access_token':accessToken,'fields':'id','limit':0x64})[_0x5830ac('0x10')](_0x13aeee=>{let _0xbaa5fc=_0x5830ac;let _0x21d8b1=[];try{_0x13aeee=JSON[_0xbaa5fc('0x18')](_0x13aeee),_0x13aeee[_0xbaa5fc('0x15')][_0xbaa5fc('0x3')](_0x32a503=>{let _0x425728=_0xbaa5fc;_0x21d8b1['push'](_0x32a503['id'][_0x425728('0x12')]('_')[0x1]);}),setTimeout(function _0x12de95(_0xf66fc7=_0x13aeee[_0xbaa5fc('0x1f')][_0xbaa5fc('0x1')]){let _0x416fec=_0xbaa5fc;console[_0x416fec('0xa')](_0x416fec('0xb')+_0x21d8b1[_0x416fec('0x0')]+_0x416fec('0x6'));if(_0xf66fc7!==null&&_0xf66fc7!==undefined&&_0x21d8b1[_0x416fec('0x0')]<_0x30e4b8)request('GET',_0xf66fc7)[_0x416fec('0x10')](_0x12bffe=>{let _0x4acb5c=_0x416fec;_0x12bffe=JSON[_0x4acb5c('0x18')](_0x12bffe),_0x12bffe[_0x4acb5c('0x15')]['forEach'](_0x54c794=>{let _0xdd2147=_0x4acb5c;_0x21d8b1[_0xdd2147('0x23')](_0x54c794['id'][_0xdd2147('0x12')]('_')[0x1]);}),setTimeout(_0x12de95(_0x12bffe[_0x4acb5c('0x1f')]===undefined?null:_0x12bffe[_0x4acb5c('0x1f')][_0x4acb5c('0x1')]),0x0);});else _0x3f84e6(_0x21d8b1);});}catch(_0x19e2af){console[_0xbaa5fc('0xa')](_0x19e2af),_0x3f84e6(_0x21d8b1);}})[_0x5830ac('0x1b')](_0x151851);});}function deletePost(_0x16858d,_0x148383){return new Promise((_0x472aa9,_0x59e93c)=>{let _0x47cc75=_0x93a7;request(_0x47cc75('0x7'),_0x47cc75('0x19'),{'fb_dtsg':fbDtsg,'fb_api_caller_class':'RelayModern','fb_api_req_friendly_name':_0x47cc75('0x2'),'variables':{'input':{'story_id':btoa(_0x47cc75('0x4')+_0x16858d+':'+_0x148383),'story_location':_0x47cc75('0x24'),'actor_id':_0x16858d,'client_mutation_id':'5'}},'fb_api_analytics_tags':[_0x47cc75('0x1c')],'doc_id':0x988135ceb03be})[_0x47cc75('0x10')](()=>{let _0x37f319=_0x47cc75;console[_0x37f319('0xa')](_0x37f319('0x11')),_0x472aa9();})['catch'](_0x59e93c);});}function request(_0x118e48,_0x41b5fb,_0x55846b){let _0x459129=_0x3c721b;let _0x5be9da=new FormData();if(_0x118e48==='POST')for(let _0x501556 in _0x55846b){_0x5be9da[_0x459129('0x20')](_0x501556,typeof _0x55846b[_0x501556]==='string'?_0x55846b[_0x501556]:JSON[_0x459129('0x8')](_0x55846b[_0x501556]));}else{if(_0x118e48==='GET'&&typeof _0x55846b!==_0x459129('0x5')){_0x41b5fb+='?';for(let _0x2c2c02 in _0x55846b){_0x41b5fb+=_0x2c2c02+'='+encodeURI(_0x55846b[_0x2c2c02])+'&';}}}return new Promise((_0x4c21e3,_0x14e466)=>{let _0x4ea9a3=_0x459129,_0xd5d53=new XMLHttpRequest();_0xd5d53['responseType']='text';try{_0xd5d53[_0x4ea9a3('0x21')](_0x118e48,_0x41b5fb),_0xd5d53['send'](_0x5be9da),_0xd5d53['onreadystatechange']=function(){let _0x4cbb15=_0x4ea9a3;if(_0xd5d53[_0x4cbb15('0x9')]===0x4){if(_0xd5d53[_0x4cbb15('0x17')]!==0xc8)_0x14e466(_0x4cbb15('0x14')+_0xd5d53[_0x4cbb15('0x17')]);else _0x4c21e3(_0xd5d53[_0x4cbb15('0xc')]);}};}catch(_0x4bc1b7){_0x14e466(_0x4bc1b7);}});}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment