print('unsubscribed to spacedicks') break # Test marking NSFW, approving/removing/reporting/distinguishing/spam # Assumes first post in user's history is in subreddit user is moderator of posts = reddit.get('/user/%s/submitted' % (reddit.user)) if len(posts) > 0: post = posts[0] print(post) print('marking... %s' % reddit.mark_nsfw(post)) print('reporting... %s' % reddit.report(post)) print('removing... %s' % reddit.remove(post)) print('spamming... %s' % reddit.spam(post)) print('approving... %s' % reddit.approve(post)) print('distinguishing %s' % reddit.distinguish(post)) # Test receiving/replying messages msgs = reddit.get('/message/messages') for msg in msgs: # Print first 40 char of all messages print(msg.__repr__()[:40]) if len(msgs) > 0: msg = msgs[0] # Reply to first message print('replying to: %s' % (msg)) success = reddit.reply(msg, "Sure, I'll s***y_watercolor that in ALL CAPS while trapped in my anus... NAUT!") if success == {}: print('unable to reply!') else:
reddit.subscribe(sub, unsub=True) print('unsubscribed to spacedicks') break # Test marking NSFW, approving/removing/reporting/distinguishing/spam # Assumes first post in user's history is in subreddit user is moderator of posts = reddit.get('/user/%s/submitted' % (reddit.user)) if len(posts) > 0: post = posts[0] print(post) print('marking... %s' % reddit.mark_nsfw(post)) print('reporting... %s' % reddit.report(post)) print('removing... %s' % reddit.remove(post)) print('spamming... %s' % reddit.spam(post)) print('approving... %s' % reddit.approve(post)) print('distinguishing %s' % reddit.distinguish(post)) # Test receiving/replying messages msgs = reddit.get('/message/messages') for msg in msgs: # Print first 40 char of all messages print(msg.__repr__()[:40]) if len(msgs) > 0: msg = msgs[0] # Reply to first message print('replying to: %s' % (msg)) success = reddit.reply( msg, "Sure, I'll s***y_watercolor that in ALL CAPS while trapped in my anus... NAUT!" ) if success == {}: