SHARE
TWEET

twitter_timeline_scroll

baptx Dec 30th, 2012 (edited) 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Scroll Twitter home (worked for profiles too before a Twitter update)
  2. /*var target_tweet = document.getElementById("stream-items-id");
  3. var target_fail = document.getElementsByClassName("stream-fail-container")[0];*/
  4.  
  5. // Scroll Twitter profiles
  6. var target_tweet = document.getElementsByClassName("GridTimeline-items")[0];
  7. var target_fail = document.getElementsByClassName("GridTimeline-failure")[0];
  8.  
  9. var height = target_tweet.scrollHeight;
  10. var observer = new MutationObserver(function(mutations) {
  11.     for (var i = 0; mutations[i]; i++)
  12.         window.scrollBy(0, height);
  13. });
  14. var config = { attributes: true, childList: true, characterData: true }
  15. observer.observe(target_tweet, config);
  16. observer.observe(target_fail, config);
  17. window.scrollBy(0, height);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top