- Java 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .gitlab/issue_templates | ||
| cleverbot | ||
| companies-house | ||
| config/checkstyle | ||
| gradle/wrapper | ||
| mojang | ||
| orna | ||
| osu | ||
| path-of-exile | ||
| runescape | ||
| steam | ||
| urban-dictionary | ||
| weblate | ||
| yugioh-prices | ||
| .editorconfig | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| build.gradle | ||
| CONTRIBUTING.md | ||
| gradlew | ||
| gradlew.bat | ||
| LICENSE | ||
| NOTICE | ||
| README.md | ||
| settings.gradle | ||
Elypiai
About
Elypiai is a collection of unofficial wrappers for web-based APIs. Each wrapper uses the same libraries and structure, so the interface is very consistent between them.
Supported Services
- Cleverbot
- Companies House
- Mojang
- Orna Guide
- osu!
- Path of Exile
- RuneScape
- Steam
- Urban Dictionary
- Yu-Gi-Oh! Prices
- Weblate
Why a monorepo?
Rather than having separate repositories for Cleverbot4J, Orna4J, osu!4J, and so on, this creates a submodule as each wrapper has an almost identical structure. In the instance we want to do major alterations in design, it usually applies to all wrappers.
Getting Started
Import
Visit Elypiai on Maven Central, and follow the instructions for your build system of choice to add the respective service wrapper to your project.
Fetching Data
In this example we'll use the Urban Dictionary API, but every module in Elypiai works more or less the same.
public class Main {
public static void main(String[] args) {
UrbanDictionary ud = new UrbanDictionary();
fetchDefinitions(ud);
fetchDefinitionsBatched(ud);
}
/**
* Invoke a REST action through the service class. You can follow-up with
* one of the following methods:
*
* #subscribe — Asynchronous request, both the success, and failure
* consumers are optional.
* #blockingGet — Synchronous (blocking) request that returns the result.
*/
public void fetchDefinitions(UrbanDictionary ud) {
ud.getDefinitions("foobar").subscribe(
(result) -> System.out.println(result),
Throwable::printStackTrace
);
DefineResult result = ud.getDefinitions("foobar").blockingGet();
}
/**
* You can batch requests too.
*/
public static void fetchDefinitionsBatched(UrbanDictionary ud) {
var requests = Stream.of("foobar", "xkcd")
.map(ud::getDefinitions)
.map(Single::toObservable)
.collect(Collectors.toList());
var batch = Observable.zip(requests, (objects) ->
Stream.of(objects).map((o) -> (DefineResult) o).collect(Collectors.toList())
);
batch.subscribe(
(results) -> results.forEach(System.out::println)
);
}
}
Read the Javadocs
All the wrappers include Javadocs, read them to learn what functions are available. If you're using a modern code editor or IDE, the code completion will display them as you access the service objects.
Interested in other web service wrappers?
There are countless web services, and countless Java wrappers available for them. If you liked this project, you may be interested in some of these packages maintained by others too:
- JDA (Java Discord API) — Discord
- GitLab4J — GitLab
- Twitch4J — Twitch