Advertisement
Guest User

Untitled

a guest
Feb 9th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. '''
  2. Created on Feb 9, 2017
  3.  
  4. @author: Ryan Schubert
  5. '''
  6.  
  7. import praw
  8.  
  9. r = praw.Reddit(client_id='REDACTED',
  10. client_secret='REDACTED',
  11. password='REDACTED',
  12. user_agent='TP_Stats by /u/stirus',
  13. username='TP_Stats')
  14.  
  15. submissions = r.subreddit('nltp').stream.submissions()
  16. uauth = {}
  17. uauth = set()
  18.  
  19. fkey = {"sb-abo", "sb-tc", "sb-tan", "sb-icp", "sbb-abo", "sbb-tc", "sbb-cj", "sbb-acap", "sb-crc", "sb-cha"}
  20.  
  21. flairs = []
  22.  
  23. i = 0
  24. x = 1
  25. for submission in submissions:
  26. comments = submission.comments
  27. for comment in comments:
  28. author = comment.author
  29. if author not in uauth:
  30. uauth.add(author)
  31. flair = comment.author_flair_css_class
  32. if flair in fkey:
  33. flairs.insert(0,flair)
  34. print(author, flair)
  35. else:
  36. print("duplicate ", i)
  37. i = i + 1
  38.  
  39. for f in fkey:
  40. print(f, flairs.count(f))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement