Last active
January 16, 2016 16:21
-
-
Save debidatta/5977865 to your computer and use it in GitHub Desktop.
Javascript for clicking on all subscribe buttons on a Reddit page. Display multiple sub-reddits using this format: http://www.reddit.com/r/4sentencemoviereviews+7films+<other sub-reddits>. Run this script to subscribe to all those sub-reddits at one go from console or from address bar using the prefix "javascript:".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e=document.getElementsByClassName('add'); | |
var i = 0,n = e.length; | |
function f() { | |
if(e[i].className.indexOf('active')>=0) e[i].click(); | |
i++; | |
if( i < n ){ | |
setTimeout( f, 3000 ); //Time out required for registering subscribe on the servers | |
} | |
} | |
f(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment