export subreddits¶
- create a new reddit app
- select
script
for the app type - use
http://localhost:8000
as the redirect url - note the client id and secret id
- put all the information down below in the script
usage¶
to get a list of your subscribed subreddits:
create a file such as subreddits.py
:
import praw
reddit = praw.Reddit(
client_id="client_id",
client_secret="your_secret_id",
user_agent="export",
username="your_username",
password="your_password",
)
# Get list of subscribed subreddits
subscribed_subreddits = [sub.display_name for sub in reddit.user.subreddits(limit=None)]
# Print the list
for sub in subscribed_subreddits:
print("- {}".format(sub))
run the script to get a list of your subreddits.