Last active
September 24, 2016 18:55
-
-
Save hyperreality/e0848104c471e2d242c29c4ac31de68a to your computer and use it in GitHub Desktop.
And auto-subscribe to favourite subreddits
This file contains 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
// To remove the inane default subreddits automatically | |
// Go to https://www.reddit.com/subreddits/ and paste the following code into your browser console | |
function clickSubredditButtons(buttons) { | |
var i = buttons.length; | |
setTimeout(function() { | |
buttons[0].click() | |
if (--i) clickSubredditButtons(buttons.slice(1)); | |
}, 500) | |
} | |
clickSubredditButtons($('.sidecontentbox').find('.remove')) | |
// The same function can easily be used to subscribe to your favourite subreddits | |
// Fill up the mySubreddits array with the subreddits you want to subscribe to | |
// Then paste those two lines into your browser console | |
var mySubreddits = ['philosophy', 'DesirePath']; | |
location.assign('https://www.reddit.com/r/' + mySubreddits.join('+')); | |
// Then use the first function above again, except this time the final line is | |
clickSubredditButtons($('.sidecontentbox').find('.add')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment