You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.1 KiB
40 lines
1.1 KiB
6 years ago
|
#!/usr/bin/env python3
|
||
|
|
||
|
users = {}
|
||
|
emojis = {}
|
||
|
|
||
|
for line in open("foolsbot.log"):
|
||
|
if line.startswith("[NEW EMOJI]"):
|
||
|
emoji = line.split(":")[0].split(" ")[2].strip()
|
||
|
if emoji not in emojis:
|
||
|
emojis[emoji] = [0, 0]
|
||
|
emojis[emoji][0] += 1
|
||
|
|
||
|
user = line.split(":")[1].strip()
|
||
|
if not user in users:
|
||
|
users[user] = [0, 0]
|
||
|
users[user][0] += 1
|
||
|
|
||
|
if line.startswith("[DEL EMOJI]"):
|
||
|
emoji = line.split(":")[0].split(" ")[2].strip()
|
||
|
if emoji not in emojis:
|
||
|
emojis[emoji] = [0, 0]
|
||
|
emojis[emoji][1] += 1
|
||
|
|
||
|
user = line.split(":")[1].strip()
|
||
|
if not user in users:
|
||
|
users[user] = [0, 0]
|
||
|
users[user][1] += 1
|
||
|
|
||
|
lusers = sorted(users.items(), key=lambda k: k[1][0] + k[1][1], reverse=True)
|
||
|
lemojis = sorted(emojis.items(), key=lambda k: k[1][0] + k[1][1], reverse=True)
|
||
|
|
||
|
print("User,Added,Removed")
|
||
|
for luser in lusers:
|
||
|
print("%s,%s,%s" % (luser[0], luser[1][0], luser[1][1]))
|
||
|
|
||
|
print(",,")
|
||
|
print("Emoji,Added,Removed")
|
||
|
for lemoji in lemojis:
|
||
|
print("%s,%s,%s" % (lemoji[0], lemoji[1][0], lemoji[1][1]))
|