Created
May 31, 2014 18:10
-
-
Save fkaa/a1d126bfde3ff6a196dd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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