Last active
February 21, 2016 20:22
-
-
Save taycaldwell/19e2a8235dbdd0caee3c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import net.rithms.riot.api.ApiConfig; | |
import net.rithms.riot.api.RiotApi; | |
import net.rithms.riot.api.RiotApiException; | |
import net.rithms.riot.api.endpoints.stats.dto.AggregatedStats; | |
import net.rithms.riot.api.endpoints.stats.dto.RankedStats; | |
import net.rithms.riot.constant.Region; | |
/** | |
* This is a simple example using the RiotApi to request summoner information for a few given summoner names | |
*/ | |
public class RankedWinsAndLosses { | |
public static void main(String[] args) throws RiotApiException { | |
RiotApi api = new RiotApi("YOUR-API-KEY-HERE"); | |
RankedStats rankedStats = api.getRankedStats(Region.EUW, 33481164); | |
// We can either get stats for a certain champion (by ID), or use 0 to get combined stats for all champions | |
AggregatedStats allChampionsStats = rankedStats.getChampions().get(0).getStats(); | |
int wins = allChampionsStats.getTotalSessionsWon(); | |
int losses = allChampionsStats.getTotalSessionsLost(); | |
System.out.println("Wins: " + wins); | |
System.out.println("Losses: " + losses); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment