From 9efb14938b925318b060b9344a2ed27ac71db5d1 Mon Sep 17 00:00:00 2001 From: Hofei90 <29521028+hofei90@users.noreply.github.com> Date: Mon, 4 May 2020 22:35:38 +0200 Subject: [PATCH] zwischenstand daten definieren --- get_cod_stats.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/get_cod_stats.py b/get_cod_stats.py index be5ee7e..c4f9e52 100644 --- a/get_cod_stats.py +++ b/get_cod_stats.py @@ -12,8 +12,26 @@ import pprint URL = "https://api.tracker.gg/api/v2/modern-warfare/standard/profile/battlenet/Hofei%232237" r = requests.get(URL) -j_r = json.loads(r.text) +data = json.loads(r.text) -#pprint.pprint(j_r) +data["userInfo"]["userId"] #userid int +stats = data["segments"][0]["stats"] #Schreibweise verkürzen +stats["kills"]["value"] # Int +stats["deaths"]["value"] # Int +stats["assists"]["value"] # Int +stats["suicides"]["value"] # Int +stats["totalGamesPlayed"]["value"] # Int +stats["wins"]["value"] # Int +stats["losses"]["value"] # Int +stats["ties"]["value"] # Int +stats["timePlayedTotal"]["value"] # int +stats["averageLife"]["value"] # float seconds +stats["careerScore"]["value"] # int +stats["headshots"]["value"] # int +stats["totalShots"]["value"] # int +stats["hits"]["value"] # int +stats["misses"]["value"] # float seconds + + +#pprint.pprint(data) -print(j_r["data"]) \ No newline at end of file