Advertisement
Guest User

Untitled

a guest
Sep 25th, 2015
2,279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. import praw
  2.  
  3. r = praw.Reddit("Warlizard karma counter v0.1")
  4.  
  5. warlizard = r.get_redditor("warlizard")
  6.  
  7. scores = []
  8. amount_no_face_in = 0
  9.  
  10. for comment in warlizard.get_comments(limit = 1000):
  11. if "ಠ_ಠ" in comment.body or "ಠ_ಠ" in comment.body: # ಠ_&#3232 = lizard face in HTML entities
  12. scores.append(comment.score)
  13. else:
  14. amount_no_face_in += 1
  15.  
  16.  
  17. print("Found {} comments with ಠ_ಠ in it".format(len(scores)))
  18. print("Found {} without".format(amount_no_face_in))
  19. print("Total amount of upvotes gained: " + str(sum(scores)))
  20. print("Mean of upvotes: " + str(sum(scores) / len(scores)))
  21. print("Most upvotes: " + str(max(scores)))
  22. print("Minimum upvotes: " + str(min(scores)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement