summaryrefslogtreecommitdiff
path: root/examples/telemetry-access.py
diff options
context:
space:
mode:
authorschneefux <schneefux+github@schneefux.xyz>2017-03-19 15:18:24 +0100
committerGitHub <noreply@github.com>2017-03-19 15:18:24 +0100
commit24c320470f8a31cb09f1fa875268e2dc868f2698 (patch)
tree9b6cef18623156d9f7abccd921dcbca25d039c91 /examples/telemetry-access.py
parent465295b223699de4bf361ec4399e12b9b30c8f2e (diff)
parentd94a6f78d1e1f2218f394c37be21926501c83e3e (diff)
downloadpython-gamelocker-24c320470f8a31cb09f1fa875268e2dc868f2698.tar.gz
python-gamelocker-24c320470f8a31cb09f1fa875268e2dc868f2698.zip
Merge pull request #5 from iAm-Kashif/master
Added example
Diffstat (limited to 'examples/telemetry-access.py')
-rw-r--r--examples/telemetry-access.py31
1 files changed, 31 insertions, 0 deletions
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