Skip to content

Instantly share code, notes, and snippets.

@arjunlol
arjunlol / sorry.py
Created September 5, 2017 21:47 — forked from benrules2/sorry.py
Reddit Sorry Counter
import praw
def get_subreddit_comments(reddit_agent, subreddit, comments_out = [], count = 100):
try:
sub = reddit_agent.get_subreddit(subreddit)
comments_raw = sub.get_comments(sub, limit=count)
comments_flat = praw.helpers.flatten_tree(comments_raw)
for comment in comments_flat:
try:
if hasattr(comment, 'comments'):