Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. javascript:var i={links:[],i:[],t:[],s:function(){_this.links=[];_this.i=[];_this.t=[]},o:function(t){return new Promise(function(i){setTimeout(i,t)})},_:function(i,t){if(t){i.className+=" inviteProcessedTrue";return!0}return i.className&&i.className.indexOf("inviteProcessedTrue")>-1},h:function(i,t,e){var n=e||100;var s=i.parentNode;if(s&&e>0){if(s.className&&s.className.indexOf(t)>-1){return s}--n;return _this.h(s,t,n)}return null},u:function(){var i=document.querySelectorAll('[aria-label="See who reacted to this"][role="toolbar"]');for(var t=0;t<i.length;t++){if(i[t]){var e=i[t].nextSibling;if(e&&e.href&&e.href.indexOf("/ufi/reaction")>-1&&_this.links.indexOf(e.href)==-1){_this.i.push(e);_this.links.push(e.href);_this.t.push(0)}}}},v:function(i,t,e){var n=i.querySelectorAll("a"),s=!0;for(var r=0;r<n.length;r++){if(n[r].className&&n[r].className.indexOf("uiMorePagerPrimary")){var o=_this.h(n[r],"async_saving",3);if(o){s=!1}}}if(s){_this.l(i,t,e);return}setTimeout(function(){_this.v(i,t,e)},200)},m:function(i,t,e,n){var s=i.shift(),r;var o=s.getAttribute("ajaxify");if(!_this._(s)&&o&&o.indexOf("post_like_invite")>-1){++n;s.click();_this.g("between_invites",function(){_this.m(i,t,e,n)});r=!0}else if(s.className&&s.className.indexOf("uiMorePagerPrimary")>-1){_this.g("between_load",function(){s.click();_this.v(t,e,n)});r=!0}_this._(s,!0);if(!r){if(i.length&&!r){_this.m(i,t,e,n);return}e(n)}},l:function(i,t,e){var n=Array.from(i.querySelectorAll("a")),s,e=e||0;_this.m(n,i,t,e)},P:function(i){var t=i.querySelector("a.layerCancel");if(t)t.click()},p:function(t){var e=document.querySelectorAll('div[role="dialog"]');for(var n=0;n<e.length;n++){if(!_this._(e[n])&&e[n].innerHTML.indexOf("Invite to Like")>-1){var i=e[n].querySelectorAll("a");for(var s=0;s<i.length;s++){var r=i[s].getAttribute("data-hovercard");if(r){_this._(e[n],!0);_this.l(e[n],function(i){_this.P(e[n]);t(i)});return}}}}setTimeout(function(){_this.p(t)},200)},T:function(i,t){i.click();_this.p(t)},k:function(e,n){_this.T(_this.i[e],function(i){_this.t[e]=i;var t=e+1;if(t<_this.i.length){_this.g("between_posts",function(){_this.k(t,n)})}else{n()}})},M:function(){var i=_this.t.reduce(function(i,t){return i+t},0);var t=_this.t.length;alert("Sent "+i+" invites from likes on "+t+" posts.")},g:function(i,t){if(_this.options["wait_"+i]){setTimeout(function(){t()},_this.options["wait_"+i][0]+Math.round(Math.random()*_this.options["wait_"+i][1]))}else{t()}},I:function(i){i=i||{};return Object.assign({D:[500,1e3],O:[1e3,2e3],j:[2e3,3e3]},i)},go:function(i){_this=this;_this.options=_this.I(i);_this.s();_this.u();_this.k(0,function(){_this.M()})}};i.go();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement