- go to https://www.reddit.com/prefs/apps and create a new script app
- copy the client_id (short weird string next to app name) and client_secret (long weird string)
- insert your mod username, password, client_id and client_secret into praw.ini
- create flair.txt file with list of flairs
- install praw library with
pip install --pre praw
- run
python flair_import.py
Created
August 26, 2016 08:34
-
-
Save Aeon/24096a2c75565714ee2a88bfcca51425 to your computer and use it in GitHub Desktop.
reddit flair importer
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
from praw import Reddit | |
reddit = Reddit() | |
sub = reddit.subreddit('wingchun') | |
editable = False | |
css = '' | |
with open('flair.txt') as f: | |
flairs = f.read().splitlines() | |
sub.flair.templates.clear() | |
for text in flairs: | |
sub.flair.templates.add(text, css, editable) |
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
[DEFAULT] | |
domain: www.reddit.com | |
ssl_domain: ssl.reddit.com | |
username: ... | |
password: ... | |
client_id: ... | |
client_secret: ... | |
user_agent: flairbot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment