diff options
author | Aki <please@ignore.pl> | 2021-05-01 18:01:11 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2021-05-01 18:01:11 +0200 |
commit | 00d10a6594125ddca8c17acbee8d2f022910f2ae (patch) | |
tree | f1171abcf3583c85707d7803980e4aa4159520f7 | |
parent | a984f8887cf42d3819bd713a33ca562d4711ef6f (diff) | |
download | field-00d10a6594125ddca8c17acbee8d2f022910f2ae.zip field-00d10a6594125ddca8c17acbee8d2f022910f2ae.tar.gz field-00d10a6594125ddca8c17acbee8d2f022910f2ae.tar.bz2 |
Fixed duplicates in teams
-rw-r--r-- | scrap.py | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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__": |