-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequest.py
More file actions
40 lines (29 loc) · 1.26 KB
/
request.py
File metadata and controls
40 lines (29 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import requests as r
class request:
URL = "https://br1.api.riotgames.com/lol/" # URL BASE
PARAMS = {'api_key': 'RGAPI-f715a504-04cc-4fb2-a265-ddc58b8cc022'}
def get(self, URL, PARAMS):
response = r.get(url=URL,
params=PARAMS).json()
return response
def getUser(self, SummonerName):
full_URL = self.URL + "summoner/v4/summoners/by-name/"
response = r.get(url=full_URL+SummonerName,
params=self.PARAMS).json()
return response
def getMatchList(self, accountId):
full_URL = self.URL + "match/v4/matchlists/by-account/"
response = r.get(url=full_URL+accountId,
params=self.PARAMS).json()
return response
def getMastery(self, encryptedSummonerId):
full_URL = self.URL + "champion-mastery/v4/champion-masteries/by-summoner/"
response = r.get(url=full_URL+encryptedSummonerId,
params=self.PARAMS).json()
return response
'''
return response
full_URL = self.URL + "champion-mastery/v4/champion-masteries/by-summoner/"
self.masteryChampions = r.get(url=full_URL+self.summoner['id'],
params=self.PARAMS).json()
'''