var keyword=prompt("Nhập vào keyword muốn tìm và xóa","0829999181"),fb_dtsg=require("DTSGInitialData").token,uid=require("CurrentUserInitialData").USER_ID,getPostID=e=>{let t,o,n=1,a=[];return e.forEach(d=>{try{1==n&&n1&&n{let t,o,n=[];return e.data.feedback.display_comments.edges.forEach(e=>{try{t=e.node.preferred_body.text,o=e.node.id,t.includes(keyword)&&(n.push(o),console.log("Phát hiện rác: "+t))}catch(e){}}),n},get_posts=async()=>{const e=await fetch("https://www.facebook.com/api/graphql/",{body:`__user=${encodeURIComponent(uid)}&__dyn=&fb_dtsg=${encodeURIComponent(fb_dtsg)}&fb_api_req_friendly_name=ProfileCometTimelineFeedRefetchQuery&variables=${encodeURIComponent(`{"UFI2CommentsProvider_commentsKey":"ProfileCometTimelineRoute","count":5,"cursor":"","feedLocation":"TIMELINE","feedbackSource":0,"omitPinnedPost":true,"privacySelectorRenderLocation":"COMET_STREAM","renderLocation":"timeline","scale":1,"should_show_profile_pinned_post":true,"useDefaultActor":false,"id":"${encodeURIComponent(uid)}"}`)}&server_timestamps=true&doc_id=3699822390076971`,method:"POST",mode:"cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"}});return(await e.text()).split("\n")},get_comments=async e=>{console.log("Đang quét post: "+e);let t=btoa("feedback:"+e);const o=await fetch("https://www.facebook.com/api/graphql/",{body:`__user=${encodeURIComponent(uid)}&__dyn=&fb_dtsg=${encodeURIComponent(fb_dtsg)}&fb_api_req_friendly_name=CometUFICommentsProviderPaginationQuery&variables=${encodeURIComponent(`{"feedLocation":"TIMELINE","feedbackID":"${t}","feedbackSource":0,"first":50,"includeHighlightedComments":false,"includeNestedComments":false,"isInitialFetch":false,"isPaginating":true,"last":null,"scale":1,"topLevelViewOption":null,"useDefaultActor":false,"viewOption":null,"UFI2CommentsProvider_commentsKey":"ProfileCometTimelineRoute"}`)}&server_timestamps=true&doc_id=3571242229635832`,method:"POST",mode:"cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"}});return await o.json()},delete_comment=async e=>{const t=await fetch("https://www.facebook.com/api/graphql/",{body:`__user=${encodeURIComponent(uid)}&__dyn=&fb_dtsg=${encodeURIComponent(fb_dtsg)}&fb_api_req_friendly_name=CometUFIDeleteCommentMutation&variables=${encodeURIComponent(`{"input":{"comment_id":"${e}","actor_id":"${encodeURIComponent(uid)}","client_mutation_id":"15"}}`)}&server_timestamps=true&doc_id=3421397307930333`,method:"POST",mode:"cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"}});return await t.json()},quet_rac=()=>{console.log("Tool xóa đống rác của DownCare"),console.log("Code by Nguyen Huu Dat - J2TEAM Community"),console.log("Bắt đầu dọn rác..."),get_posts().then(e=>getPostID(e)).then(e=>Promise.all(e.map(e=>get_comments(e).then(e=>checkComment(e)).then(e=>Promise.all(e.map(e=>delete_comment(e).then(t=>console.log("Đã xoá comment "+e)))))))).then(()=>console.log("Đã dọn xong đống rác..."))};quet_rac();