2016-02-14 14:47:53 +00:00
|
|
|
import requests
|
|
|
|
import filemanager
|
|
|
|
|
|
|
|
lolkey = filemanager.readfile("lolapi.txt")
|
|
|
|
|
|
|
|
|
2016-03-04 18:17:05 +00:00
|
|
|
def getchampionstaticdata(cid, extra=None):
|
2016-02-14 14:47:53 +00:00
|
|
|
parametri = {
|
|
|
|
'api_key': lolkey,
|
|
|
|
'region': "euw",
|
|
|
|
'locale': "it_IT",
|
|
|
|
'id': cid,
|
|
|
|
'champData': extra,
|
|
|
|
}
|
|
|
|
r = requests.get("https://global.api.pvp.net/api/lol/static-data/euw/v1.2/champion/" + str(cid),
|
|
|
|
params=parametri).json()
|
|
|
|
return r
|
|
|
|
|
|
|
|
|
|
|
|
def getfreerotation():
|
|
|
|
parametri = {
|
|
|
|
'freeToPlay': 'true',
|
|
|
|
'region': "euw",
|
|
|
|
'api_key': lolkey
|
|
|
|
}
|
|
|
|
r = requests.get("https://euw.api.pvp.net/api/lol/euw/v1.2/champion", params=parametri).json()
|
|
|
|
return r['champions']
|