Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var scroll = document.querySelector('div.uiLayer div[role=dialog] div.uiScrollableAreaWrap');
  2. var lastScroll = -1;
  3. var it = 0;
  4.  
  5. var INTERVAL = window.setInterval(function() {
  6.   console.log(it);
  7.   if (it >= 7)
  8.   {
  9.       window.clearInterval(INTERVAL);
  10.       console.log('FINISH; START INVITING');
  11.       var invites = document.querySelectorAll('div[role=dialog] div.uiScrollableAreaWrap a[ajaxify*="invite"]');
  12.       for (var i=0; i < invites.length; ++i) invites[i].click()
  13.   }
  14.  
  15.   if (scroll.scrollTop == lastScroll)
  16.   {
  17.         console.log('equal');
  18.        it += 1;
  19.   }
  20.   else
  21.        it = 0
  22.  
  23.   lastScroll = scroll.scrollTop;
  24.  
  25.   var seeMore = document.querySelector('#reaction_profile_pager .uiMorePagerPrimary');
  26.   if (seeMore) seeMore.click();
  27.  
  28.   scroll.scrollTop += 1000;
  29. }, 700);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement