Created
August 12, 2020 02:11
-
-
Save CaptainZidgel/d3f7cb099702490d90c44d33f8c24bc2 to your computer and use it in GitHub Desktop.
Quick and simple collecter of aliases used in logs. Non interactive, requires you to copy/paste values to wherever you're trying to assosciate IDs with permanent Aliases.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
from collections import Counter | |
import sys | |
non_bmp_map = dict.fromkeys(range(0x10000, sys.maxunicode + 1), 0xfffd) | |
IDs = {} | |
for file in os.listdir(".logs"): | |
with open(os.path.join('.logs', file), "r") as f: | |
l = json.load(f) | |
for id, name in l['names'].items(): | |
if not id in IDs: | |
IDs[id] = [] | |
IDs[id].append(name.lower().translate(non_bmp_map)) | |
for ID, names in IDs.items(): | |
print("::::{}::::".format(ID)) | |
print(Counter(names)) | |
print('\n\n\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment