Created
March 18, 2012 03:42
-
-
Save sparr/2068606 to your computer and use it in GitHub Desktop.
get list of subreddits we are banned from
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
# fetch our inbox, find subreddits we are banned from in advance | |
my_inbox = None | |
try: | |
my_inbox = r.user.get_inbox() | |
except: | |
#TODO: handle some exceptions here! | |
raise | |
if (my_inbox): | |
for m in my_inbox: | |
s = re.match("you have been banned from posting to \[.*\]\(/r/(.*)/\)\.",m.body) | |
if (s != None): | |
banned_subreddits.add(s.group(1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment