Advertisement
Guest User

Untitled

a guest
Jul 24th, 2018
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Lists out all a person's followers.
  2. //Slightly less basic script that also automatically scrolls to the bottom of the page. Based on https://pastebin.com/AHULAAHd
  3. var myJSON;
  4. var aFollow = [];
  5. function scroll(){
  6.     window.scrollTo(0, document.body.scrollHeight);
  7.     window.setTimeout(scroll, 300);
  8.    
  9.     var followers = document.querySelectorAll('.ProfileCard.js-actionable-user');
  10.     followers.forEach(function(follower){
  11.         var fol = {};
  12.         fol["name"] = follower.querySelector('.fullname').textContent;
  13.         fol["handle"] = follower.querySelector('.username b').textContent;
  14.         fol["url"] = "http://twitter.com/" + fol["handle"];
  15.         aFollow.push(fol);
  16.     });
  17.     myJSON = JSON.stringify(aFollow);
  18. }
  19. scroll();
  20. //Call myJSON in console and copy it, trying to print it throws an undefined because of the size.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement