Skip to content

Instantly share code, notes, and snippets.

@fkaa
Created May 31, 2014 18:10
Show Gist options
  • Select an option

  • Save fkaa/a1d126bfde3ff6a196dd to your computer and use it in GitHub Desktop.

Select an option

Save fkaa/a1d126bfde3ff6a196dd to your computer and use it in GitHub Desktop.
import praw
from collections import defaultdict
reddit = praw.Reddit(user_agent='karma_scraper')
subreddit = reddit.get_subreddit('combatfootage')
results = subreddit.get_top(limit=1000)
out = defaultdict(int)
for result in results:
out.update({result.author:out.get(result.author, 0) + result.score})
for key, value in out.iteritems():
print "%s: %s" % (key, value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment