我刚开始使用Riot API,而且我很难通过他们的排名来获得召唤者。我使用了try: #python 2 code, throws TypeError in python 3
out = color_out + out + color_reset
except TypeError: #python 3 code
out = color_out + out.decode('utf-8','ignore') + color_reset
finally:
sys.stdout.write(out)
函数,但它检索的数据与已经运行的其他网站不同。
我这样用:
getChampion()
在我使用<?php
include('php-riot-api.php');
include('FileSystemCache.php');
//testing classes
//using double quotes seems to make all names work (see issue: https://github.com/kevinohashi/php-riot-api/issues/33)
$summoner_name = "RiotSchmick";
$summoner_id = 585897;
$test = new riotapi('na');
$testCache = new riotapi('na', new FileSystemCache('cache/'));
$r = $test->getChampion(); echo "<pre>"; print_r($r);echo "</pre>";
this fetch array like this
[champions] => Array
(
[0] => Array
(
[id] => 266
[active] => 1
[botEnabled] =>
[freeToPlay] => 1
[botMmEnabled] =>
[rankedPlayEnabled] => 1
)
[1] => Array
(
[id] => 103
[active] => 1
[botEnabled] =>
[freeToPlay] =>
[botMmEnabled] =>
[rankedPlayEnabled] => 1
) ..................
之后,我从上面的数组得到了所有id。但是我获得的汇总人名称与其他正在运行的网站不同,例如http://na.op.gg/ranking/ladder/和http://quickfind.kassad.in/rankings/na(这两个网站都有相同的数据,但我的不同)。
答案 0 :(得分:1)
我相信你想使用https://euw.api.pvp.net/api/lol/euw/v2.5/league/master?type=RANKED_SOLO_5x5&api_key=
和https://euw.api.pvp.net/api/lol/euw/v2.5/league/challenger?type=RANKED_SOLO_5x5&api_key=
API,而不是使用summonerID数据。