https://github.com/renbinden/elympics-api
Elympics API for Java
https://github.com/renbinden/elympics-api
Last synced: 11 months ago
JSON representation
Elympics API for Java
- Host: GitHub
- URL: https://github.com/renbinden/elympics-api
- Owner: renbinden
- License: other
- Created: 2017-02-22T08:34:06.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-22T08:41:20.000Z (over 9 years ago)
- Last Synced: 2025-07-04T10:57:47.311Z (11 months ago)
- Language: Java
- Size: 58.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# elympics-api
This is a Java API for Dollarone's elympics.
See https://dollarone.games/elympics/ to get a key.
## Maven
```xml
seventh-root-repo
https://repo.seventh-root.com/artifactory/libs-release-local/
games.dollarone
elympics-api
1.0.0
```
## Gradle
```groovy
repositories {
maven { url "https://repo.seventh-root.com/artifactory/libs-release-local/" }
}
dependencies {
compile group: 'games.dollarone', name: 'elympics-api', version: '1.0.0'
}
```
## Usage
```java
Elympics elympics = Elympics.connect("xxx"); // Where xxx is your API key
// Viewing high scores in order
try {
final List highscores = elympics.getHighscores();
Collections.sort(highscores);
for (ElympicsHighscore highscore : highscores) {
System.out.println(highscore.getName() + " - " + highscore.getScore());
}
} catch (IOException exception) {
// Handle failure
}
// Viewing high scores in reverse order
try {
final List highscores = elympics.getHighscores();
highscores.sort(Collections.reverseOrder());
} catch (IOException exception) {
// Handle failure
}
// Submitting a high score
try {
// With an object with a BigInteger score
elympics.submitHighscore(new ElympicsHighscore("Name", BigInteger.valueOf(9001)));
// With an object with a primitive score (long, int, etc)
elympics.submitHighscore(new ElympicsHighscore("Name", 9001));
// No object, BigInteger score
elympics.submitHighscore("Name", BigInteger.valueOf(9001));
// No object, primitive score (long, int, etc)
elympics.submitHighscore("Name", 9001);
} catch (IOException exception) {
// Handle failure
}
```
This work includes modified parts of the GitHub API for Java, Copyright (c) 2011 Kohsuke Kawaguchi and other contributors, licensed under the MIT license. The license may be found at LICENSE-github-api-for-java.