-
-
Save nkhil/f07502f726f403ea642cf1d26b383ef2 to your computer and use it in GitHub Desktop.
Revisions
-
timvisee revised this gist
Mar 2, 2021 . No changes.There are no files selected for viewing
-
timvisee revised this gist
Mar 2, 2021 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ As posted on: https://timvisee.com/blog/list-export-your-subreddits/ # Get a list of your subreddits To obtain a list of your subreddits, do the following: -
timvisee revised this gist
Aug 20, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ # Get a list of your subreddits To obtain a list of your subreddits, do the following: - First make sure you're logged in on [reddit](https://reddit.com), on a desktop browser. - Then visit [reddit.com/subreddits](https://reddit.com/subreddits). - Then put the following snippet in your browsers address bar, and press `Enter`. Make sure `javascript:` is included at the beginning, your browser might remove it while copy-pasting for security reasons: -
timvisee created this gist
Aug 20, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ # Get a list of your subreddits To obtain a list of your subreddits, do the following: - First make sure you're logged in on [reddit](https://reddit.com). - Then visit [reddit.com/subreddits](https://reddit.com/subreddits). - Then put the following snippet in your browsers address bar, and press `Enter`. Make sure `javascript:` is included at the beginning, your browser might remove it while copy-pasting for security reasons: ```javascript javascript:$('body').replaceWith('<body>'+$('.subscription-box').find('li').find('a.title').map((_, d) => $(d).text()).get().join("<br>")+'</body>');javascript.void() ``` - The reddit page is replaced with a list of all the subreddits you're subscribed to. # For nerds Here is the expanded snippet: ```javascript // Build a list of subreddits with break lines between them var subs = $('.subscription-box') .find('li') .find('a.title') .map((_, d) => $(d).text()) .get() .join("<br>")); // Replace the page with a list of subreddits $('body').replaceWith('<body>' + subs +'</body>'); javascript.void() ``` It finds all items from the subreddit list in the sidebar on the page, and builds an array of subreddit names from it. The array is concatinated with breaklines. The page is then replaced with this list.