Skip to content

Instantly share code, notes, and snippets.

@sparr
Created March 18, 2012 03:42
Show Gist options
  • Save sparr/2068606 to your computer and use it in GitHub Desktop.
Save sparr/2068606 to your computer and use it in GitHub Desktop.
get list of subreddits we are banned from
# 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