-
Notifications
You must be signed in to change notification settings - Fork 46
/
thread_comparer.py
38 lines (30 loc) · 1.08 KB
/
thread_comparer.py
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
import discord_logging
import praw
log = discord_logging.init_logging(debug=True)
if __name__ == "__main__":
reddit = praw.Reddit("Watchful1")
thread1 = reddit.submission("xl64vn")
thread2 = reddit.submission("xm29lm")
log.info("Loading thread 1")
thread1.comments.replace_more(limit=None)
log.info("Done")
log.info("Loading thread 2")
thread2.comments.replace_more(limit=None)
log.info("Done")
log.info("Building commenters for 1")
thread1_commenters = set()
for comment in thread1.comments.list():
thread1_commenters.add(comment.author.name)
log.info(f"Count commenters {len(thread1_commenters)}")
log.info("Building commenters for 2")
thread2_commenters = set()
for comment in thread2.comments.list():
thread2_commenters.add(comment.author.name)
log.info(f"Count commenters {len(thread2_commenters)}")
missing_commenters = []
for commenter in thread1_commenters:
if commenter not in thread2_commenters:
missing_commenters.append(commenter)
log.info(f"Missing commenters {len(missing_commenters)}")
for commenter in missing_commenters:
log.info(f"u/{commenter}")