Currently the list is return-separated and " (break)" separated as well, but of course it could be in any other format such as csv. or whatever.
Hoping someone here could help me. I scoured google to try and find a solution but couldn't for the life of me, I must be missing something in my search! I'm surprised that nobody else would like this functionality.
here is a naive solution with praw, it assumes you have a text file containing the subreddits you wish to subscribe to (separate lines for each subreddit) and a custom application added to your reddit account:
import praw
reddit = praw.Reddit(
user_agent="mass sub",
# visit https://old.reddit.com/prefs/apps/ to add a new script
# choose http://localhost:8080 as a random and unused callback url
# fill in the correct credentials
client_id="",
client_secret="",
username="",
password=""
)
file1 = open('./some_txt_file_of_subreddits', 'r')
Lines = file1.readlines()
for line in Lines:
print("Line: {}".format(line.strip()))
reddit.subreddit(line.strip()).subscribe()
if you need to generate a list of subreddits from an existing account you can use this bookmarklet
The bookmarklet script below should be run on https://www.reddit.com/subreddits/mine/
javascript:$('body').replaceWith('<body>'+$('.subscription-box').find('li').find('a.title').map((_, d) => $(d).text()).get().join("<br>")+'</body>');javascript.void()
where the output can be saved to a text file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With