【问题标题】:Fetch summoners by ranking in Riot Api通过 Riot Api 中的排名来获取召唤师
【发布时间】:2015-05-21 14:30:28
【问题描述】:

我刚开始使用 Riot API,我一直坚持通过排名来获取召唤师。我使用了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
                ) ..................

在我使用$r-&gt;getSummoner(266); // 103 和我从上面的数组中获得的所有 id 之后。但是我得到的召唤师名字和http://na.op.gg/ranking/ladder/http://quickfind.kassad.in/rankings/na等其他正在运行的站点不同(这两个站点的数据相同,但我的不同)。

【问题讨论】:

  • edit 提出您的问题,说明您是如何使用 API 的,以及结果与您的预期有何不同。
  • @Mat!我添加了有问题的代码,请再次查看。谢谢你

标签: riot-games-api


【解决方案1】:

我相信你想使用https://euw.api.pvp.net/api/lol/euw/v2.5/league/master?type=RANKED_SOLO_5x5&amp;api_key=https://euw.api.pvp.net/api/lol/euw/v2.5/league/challenger?type=RANKED_SOLO_5x5&amp;api_key= API,而不是使用 SummonerID 数据。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-27
    • 2021-02-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-09
    相关资源
    最近更新 更多