summaryrefslogtreecommitdiff
path: root/crawler.py
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-01-26 23:50:22 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2017-01-27 10:42:05 +0100
commit0c7abdcf1887285a5dccf0073629521a91cc0276 (patch)
treef74e04b93f9b2df7eab6e6b47c644224529ec1c9 /crawler.py
parent8b3cc388c11ab0f56e998728c0f61f1ef782f777 (diff)
downloadapigrabber-0c7abdcf1887285a5dccf0073629521a91cc0276.tar.gz
apigrabber-0c7abdcf1887285a5dccf0073629521a91cc0276.zip
api: demo /matches endpoint
Diffstat (limited to 'crawler.py')
-rw-r--r--crawler.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/crawler.py b/crawler.py
index 07ca22f..68b994f 100644
--- a/crawler.py
+++ b/crawler.py
@@ -37,6 +37,13 @@ class Crawler(object):
assert response.status == 200
return await response.json()
+ async def version(self):
+ """Returns the current API version."""
+
+ async with aiohttp.ClientSession() as session:
+ status = await self._req(session, "status")
+ return status["data"]["attributes"]["version"]
+
async def matches(self, region="na", params=None):
"""Queries the API for matches and their related data.