From 9a4f0be81079c6d37f24b9183bc6d296369d55f6 Mon Sep 17 00:00:00 2001 From: schneefux Date: Thu, 16 Mar 2017 21:34:38 +0100 Subject: Example added for Telemetry. Signed-off-by: Kashif Memon --- examples/telemetry-access.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 examples/telemetry-access.py (limited to 'examples/telemetry-access.py') diff --git a/examples/telemetry-access.py b/examples/telemetry-access.py new file mode 100644 index 0000000..166c8e9 --- /dev/null +++ b/examples/telemetry-access.py @@ -0,0 +1,31 @@ +#!/usrz/bin/python + +# +#How to access Telemetry using python - gamelocker# +# +import gamelocker +vgApiKey = '' +api = gamelocker.Gamelocker(vgApiKey).Vainglory() + + +# Get telemetry URL for a particular match played by IGN. +def getTelemetryInfo(IGN): + try: + matches = api.matches({ + "sort": "-createdAt", + "filter[playerNames]": IGN, + "filter[createdAt-start]": "2017-03-10T00:00:00Z", + "page[limit]": "1" + }) + + if (matches == False): + print("No Matches found") + else : + match = matches[0] + print('Time Played: ', match.createdAt) + print('GameMode: ', match.gameMode) + print(match.assets[0].name, match.assets[0].url) + except: + print("Invalid Name") + +getTelemetryInfo("IGN") \ No newline at end of file -- cgit v1.3.1