-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_user.py
More file actions
38 lines (28 loc) · 1.06 KB
/
check_user.py
File metadata and controls
38 lines (28 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import threading
from reddit import get_reddit
def set_gyw_score(user):
reddit = get_reddit()
comment_score = 0
post_score = 0
for comment in reddit.redditor(user).comments.new(limit=None):
if comment.subreddit.display_name == 'goodyearwelt':
comment_score += comment.score
for submission in reddit.redditor(user).submissions.new(limit=None):
if submission.subreddit.display_name == 'goodyearwelt':
post_score += submission.score
score = post_score + comment_score
reddit.subreddit('Shoeexchange').flair.set(user, 'GYW Score: {} '.format(score))
users_to_check = []
reddit = get_reddit()
for comment in reddit.subreddit('Shoeexchange').comments(limit=None):
if comment.author is None:
continue
if comment.author == "AutoModerator":
continue
user = comment.author.name
if user in users_to_check:
continue
users_to_check.append(user)
for user in users_to_check:
t = threading.Thread(target=set_gyw_score, args=(user,))
t.start()