Advertisement
Guest User

Untitled

a guest
Jul 24th, 2018
111
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. function scroll(){
  5.     window.scrollTo(0, document.body.scrollHeight);
  6.     window.setTimeout(scroll, 300);
  7.     var aFollow = [];
  8.     var followers = document.querySelectorAll('.ProfileCard.js-actionable-user');
  9.     followers.forEach(function(follower){
  10.         var fol = {};
  11.         fol["name"] = follower.querySelector('.fullname').textContent;
  12.         fol["handle"] = follower.querySelector('.username b').textContent;
  13.         fol["url"] = "http://twitter.com/" + fol["handle"];
  14.         aFollow.push(fol);
  15.     });
  16.     myJSON = JSON.stringify(aFollow);
  17. }
  18. scroll();
  19. //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