Flicker is a Java Adaptation of the Vainglory API.
There are a couple of different ways that you can integrate Flicker into your application.
If you use Maven to manage your dependencies, Flicker is available from Maven Central:
<dependency>
<groupId>gg.vain</groupId>
<artifactId>flicker</artifactId>
<version>4.1.0</version>
</dependency>
If you use Gradle to manage your dependencies, Flicker is available from Maven Central:
repositories {
mavenCentral()
}
dependencies {
compile 'gg.vain:flicker:4.1.0'
}
Just download the latest .jar and add it to your project's build path.
We recommend creating a lib/ directory in your project's root directory and putting the .jar there. You can find a pretty good explanation of how to include the lib to your project using IntelliJ here.
Flicker blocking and non blocking implementations, you should use whichever suits your needs.
public static void main(String[] args) {
FlickerApi flickerApi = new FlickerApi("aaa.bbb.ccc");
List <Match> matchList = flickerApi.getMatches();
for (Match match: matchList) {
System.out.println("Match " + match.getId() + ", was created at " + match.getCreatedAt());
for (Roster roster: match.getRoster()) {
for (Participant participant: roster.getParticipants()) {
Player player = flickerApi.getPlayerById(participant.getPlayer().getId());
System.out.println("Player " + player.getName() + ", has " + player.getPlayerStats().getLifetimeGold() + " lifetime gold");
}
}
}
}
public static void main(String[] args) {
FlickerAsyncApi flickerAsyncApi = new FlickerAsyncApi("aaa.bbb.ccc");
flickerAsyncApi.getMatches().thenAccept(matchList - > {
for (Match match: matchList) {
System.out.println("Match " + match.getId() + ", was created at " + match.getCreatedAt());
for (Roster roster: match.getRoster()) {
for (Participant participant: roster.getParticipants()) {
flickerAsyncApi.getPlayerById(participant.getPlayer().getId()).whenComplete((player, throwable) - > {
if (throwable != null) {
throwable.printStackTrace();
}
System.out.println("Player " + player.getName() + ", has " + player.getPlayerStats().getLifetimeGold() + " lifetime gold");
});
}
}
}
});
}
Flicker currently depends on the following libraries:
- Async Http Client v2.0.32
- JSONAPI Converter v0.7
Flicker as a very early stage of development, it is likely that some feature you want may not yet exist - do feel free to make pull requests!