-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent.js
1 lines (1 loc) · 7.08 KB
/
content.js
1
function _0x599a(_0x13097c,_0x59c2a6){const _0x29b6dd=_0x29b6();return _0x599a=function(_0x599a0d,_0x1e45c1){_0x599a0d=_0x599a0d-0xa0;let _0x41bad3=_0x29b6dd[_0x599a0d];return _0x41bad3;},_0x599a(_0x13097c,_0x59c2a6);}function _0x29b6(){const _0x129f52=['h3\x20a','reduce','10yVTiiH','334167yPFZat','join','14729670RtrgUL','1198452MddVAU','action','then','name','Cleaning\x20up\x20variables\x20and\x20state...','forEach','innerText','\x22,\x22','add','Ver\x20respostas','remove','ul._a9ym\x20li._a9zj','280734rAWUpw','onMessage','Ocultar\x20respostas','href','createElement','warn','button._a9ze\x20span','push','clicked','\x20comments\x20so\x20far...','12cRFsov','a\x20img[alt^=\x22Foto\x20do\x20perfil\x20de\x22]','querySelectorAll','[aria-label=\x22Carregar\x20mais\x20comentários\x22]','classList','1878506FezTZJ','createObjectURL','button[class*=\x22_ap30\x22]:not(.fully-expanded)','Starting\x20to\x20scrape...','from','nodeValue','includes','5wmALRy','textContent','CSV\x20file\x20has\x20been\x20downloaded.','Success','comment','Scanning\x20more\x20comments...','DOM\x20state\x20reset.','some','runtime','updateStatus','time._a9ze','datetime','length','click','Scraping\x20completed.','filter','div.xt0psk2\x20span','button.clicked','trim','querySelector','Username,Comment,PublishDate,CountLikes,URL,Avatar','fully-expanded','tagName','src','nodeType','Loading\x20more\x20comments...','Error','2975346SwZsco','3746512hpZfwF','startScraping','addListener','log','Content\x20script\x20loaded\x20and\x20running','replace'];_0x29b6=function(){return _0x129f52;};return _0x29b6();}(function(_0x52d58d,_0x22ad1e){const _0x3f020d=_0x599a,_0x25775e=_0x52d58d();while(!![]){try{const _0x522c34=-parseInt(_0x3f020d(0xdf))/0x1+-parseInt(_0x3f020d(0xde))/0x2*(-parseInt(_0x3f020d(0xa4))/0x3)+-parseInt(_0x3f020d(0xe2))/0x4*(-parseInt(_0x3f020d(0xba))/0x5)+-parseInt(_0x3f020d(0xae))/0x6*(-parseInt(_0x3f020d(0xb3))/0x7)+parseInt(_0x3f020d(0xd6))/0x8+parseInt(_0x3f020d(0xd5))/0x9+-parseInt(_0x3f020d(0xe1))/0xa;if(_0x522c34===_0x22ad1e)break;else _0x25775e['push'](_0x25775e['shift']());}catch(_0x42a91d){_0x25775e['push'](_0x25775e['shift']());}}}(_0x29b6,0x48439),(function(){const _0x4045e9=_0x599a;console[_0x4045e9(0xd9)](_0x4045e9(0xda));let _0x3824a2=[],_0x250b39=![];function _0x537288(_0x2f73dd){const _0x1244e2=_0x4045e9;chrome[_0x1244e2(0xc2)]['sendMessage']({'action':_0x1244e2(0xc3),'status':_0x2f73dd});}const _0x479fce=()=>{const _0x57f495=_0x4045e9;document['querySelectorAll'](_0x57f495(0xcb))[_0x57f495(0xe7)](_0x2070d0=>_0x2070d0[_0x57f495(0xb2)][_0x57f495(0xa2)]('clicked')),document[_0x57f495(0xb0)]('button.fully-expanded')['forEach'](_0x5f2981=>_0x5f2981[_0x57f495(0xb2)][_0x57f495(0xa2)](_0x57f495(0xcf))),console[_0x57f495(0xd9)](_0x57f495(0xc0));},_0x3333a4=()=>{return new Promise(_0x3626db=>{const _0x4fd4bc=_0x599a,_0x45fbb2=()=>{const _0x1ea47f=_0x599a,_0x154ffc=Array[_0x1ea47f(0xb7)](document[_0x1ea47f(0xb0)](_0x1ea47f(0xb5)))[_0x1ea47f(0xc9)](_0x158a5b=>_0x158a5b['innerText']['includes'](_0x1ea47f(0xa1))&&!_0x158a5b[_0x1ea47f(0xe8)][_0x1ea47f(0xb9)](_0x1ea47f(0xa6)));if(_0x154ffc[_0x1ea47f(0xc6)]===0x0){_0x3626db();return;}_0x154ffc[_0x1ea47f(0xe7)](_0x21fe99=>{const _0x296a90=_0x1ea47f;_0x21fe99[_0x296a90(0xc7)](),_0x21fe99[_0x296a90(0xb2)]['add'](_0x296a90(0xac)),setTimeout(()=>{const _0x541280=_0x296a90,_0x1143ea=/\(\d+\)/;!_0x1143ea['test'](_0x21fe99[_0x541280(0xe8)])?_0x21fe99['classList'][_0x541280(0xa0)](_0x541280(0xcf)):_0x21fe99[_0x541280(0xb2)][_0x541280(0xa2)]('clicked');},0x3e8);}),setTimeout(_0x45fbb2,0x7d0);};_0x537288(_0x4fd4bc(0xbf)),_0x45fbb2();});},_0x953012=async()=>{const _0x17ce8f=_0x4045e9,_0x2ba761=document[_0x17ce8f(0xcd)](_0x17ce8f(0xb1));if(_0x2ba761)return _0x2ba761['dispatchEvent'](new MouseEvent('click',{'bubbles':!![],'cancelable':!![]})),await new Promise(_0x1c9f4b=>setTimeout(_0x1c9f4b,0xbb8)),_0x537288(_0x17ce8f(0xd3)),!![];return![];};function _0x3e4b59(){const _0x39787f=_0x4045e9,_0x184111=document['querySelectorAll'](_0x39787f(0xa3));_0x184111[_0x39787f(0xe7)](_0x82985b=>_0x6a51eb(_0x82985b)),_0x537288('Collected\x20'+_0x3824a2['length']+_0x39787f(0xad));}function _0x6a51eb(_0x52e469){const _0x3b326d=_0x4045e9,_0x4c5c54=_0x52e469[_0x3b326d(0xcd)](_0x3b326d(0xdc)),_0x459774=_0x52e469['querySelector'](_0x3b326d(0xca)),_0x170aae=_0x52e469['querySelector'](_0x3b326d(0xc4)),_0x4f890d=_0x52e469[_0x3b326d(0xcd)](_0x3b326d(0xaa)),_0x9eb391=_0x52e469[_0x3b326d(0xcd)](_0x3b326d(0xaf)),_0x3dce96=_0x4c5c54?_0x4c5c54[_0x3b326d(0xe8)][_0x3b326d(0xcc)]():'Unknown',_0x411d4c=_0x459774?Array[_0x3b326d(0xb7)](_0x459774['childNodes'])[_0x3b326d(0xdd)]((_0x3f9e78,_0xc26db3)=>{const _0x4bec83=_0x3b326d;return _0x3f9e78+(_0xc26db3[_0x4bec83(0xd2)]===0x3?_0xc26db3[_0x4bec83(0xb8)]:_0xc26db3[_0x4bec83(0xd0)]==='BR'?'\x20':_0xc26db3[_0x4bec83(0xe8)]);},'')['replace'](/\s+/g,'\x20')[_0x3b326d(0xcc)]():'',_0x7a5f76=_0x170aae?_0x170aae['getAttribute'](_0x3b326d(0xc5)):'',_0x3f27c0=_0x4f890d?_0x4f890d[_0x3b326d(0xbb)][_0x3b326d(0xdb)](/\D/g,''):'',_0xdb6042=_0x3f27c0?parseInt(_0x3f27c0,0xa):0x0,_0x496932=_0x9eb391?_0x9eb391[_0x3b326d(0xd1)]:'',_0x2a0a66={'name':_0x3dce96,'comment':_0x411d4c,'datetime':_0x7a5f76,'likes':_0xdb6042,'utilizador':'https://www.instagram.com/'+_0x3dce96,'avatar':_0x496932};!_0x3824a2[_0x3b326d(0xc1)](_0x1699f9=>_0x1699f9['comment']===_0x2a0a66[_0x3b326d(0xbe)]&&_0x1699f9[_0x3b326d(0xe5)]===_0x2a0a66[_0x3b326d(0xe5)])&&_0x3824a2[_0x3b326d(0xab)](_0x2a0a66);}async function _0x4d87c7(){const _0x372201=_0x4045e9;if(_0x250b39){console[_0x372201(0xa9)]('Scraping\x20is\x20already\x20in\x20progress.');return;}_0x250b39=!![],_0x3824a2=[],_0x479fce(),_0x537288(_0x372201(0xb6));let _0x550015=!![];await _0x3333a4(),_0x3e4b59();while(_0x550015){_0x550015=await _0x953012(),await _0x3333a4(),_0x3e4b59();}_0x537288(_0x372201(0xc8)),_0x1412d9(_0x3824a2),_0x367725();}function _0x1412d9(_0x4b8c8f){const _0x58ce4d=_0x4045e9,_0x84872e=[_0x58ce4d(0xce)];_0x4b8c8f[_0x58ce4d(0xe7)](({name:_0xa16073,comment:_0x37d7a7,datetime:_0x3a76fd,likes:_0x5d72b8,utilizador:_0x33f06a,avatar:_0x437ddc})=>{const _0x1e5e62=_0x58ce4d;_0x84872e['push']('\x22'+_0xa16073[_0x1e5e62(0xdb)](/"/g,'\x22\x22')+_0x1e5e62(0xe9)+_0x37d7a7[_0x1e5e62(0xdb)](/"/g,'\x22\x22')+_0x1e5e62(0xe9)+_0x3a76fd+'\x22,\x22'+_0x5d72b8+'\x22,\x22'+_0x33f06a+_0x1e5e62(0xe9)+_0x437ddc+'\x22');});const _0x21df81=_0x84872e[_0x58ce4d(0xe0)]('\x0a'),_0x98c87f=new Blob([_0x21df81],{'type':'text/csv;charset=utf-8;'}),_0x469eec=URL[_0x58ce4d(0xb4)](_0x98c87f),_0x5bb68c=document[_0x58ce4d(0xa8)]('a');_0x5bb68c[_0x58ce4d(0xa7)]=_0x469eec,_0x5bb68c['download']='comments.csv',_0x5bb68c[_0x58ce4d(0xc7)](),URL['revokeObjectURL'](_0x469eec),console[_0x58ce4d(0xd9)](_0x58ce4d(0xbc));}function _0x367725(){const _0x580b43=_0x4045e9;console['log'](_0x580b43(0xe6)),_0x479fce(),_0x3824a2=[],_0x250b39=![];}chrome['runtime'][_0x4045e9(0xa5)][_0x4045e9(0xd8)]((_0x1ae504,_0x19f3e1,_0x553ad1)=>{const _0x4abae3=_0x4045e9;if(_0x1ae504[_0x4abae3(0xe3)]===_0x4abae3(0xd7))return _0x4d87c7()[_0x4abae3(0xe4)](()=>{const _0x82bc18=_0x4abae3;_0x553ad1({'status':_0x82bc18(0xbd)});})['catch'](_0x155605=>{const _0xd24bc7=_0x4abae3;_0x553ad1({'status':_0xd24bc7(0xd4),'message':_0x155605});}),!![];});}()));