From 00d10a6594125ddca8c17acbee8d2f022910f2ae Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 1 May 2021 18:01:11 +0200 Subject: Fixed duplicates in teams --- scrap.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scrap.py b/scrap.py index c28b1c0..07e4036 100644 --- a/scrap.py +++ b/scrap.py @@ -70,13 +70,12 @@ def main(): related.feed(page) killmails = [] - teams = ([], []) + teams = (set(), set()) for team, kill, owner in related.kills: time.sleep(1.05) # Zkillboard is very sensitive. killmails.append({"id": int(kill), "hash": get_hash(kill)}) destination = teams[team - 1] - if owner not in destination: - destination.append(int(owner)) + destination.add(int(owner)) if args.output: filename = args.output @@ -88,7 +87,7 @@ def main(): filename = "scrapped.json" with open(filename, "w") as file: - file.write(json.dumps({"killmails": killmails, "teams": teams})) + file.write(json.dumps({"killmails": killmails, "teams": tuple(map(list, teams))})) if __name__ == "__main__": -- cgit v1.1