The official Java API library for Memerator.
Stable builds are published to Central, so you only need the dependency. Replace [version] with the version below (without the "v")
<!-- Memerator API -->
<dependency>
<groupId>me.memerator.api</groupId>
<artifactId>MemeratorAPI</artifactId>
<version>[version]</version>
</dependency>
To stay up to date with Memerator features (but with potentially more breaking changes), consider our dev builds.
Maven:
First, you need Chew's Jenkins repository
<repository>
<id>chew-jenkins</id>
<url>https://jenkins.chew.pw/plugin/repository/everything/</url>
</repository>
Then, you'll need to install the build you want. All are considered dev builds unless otherwise specified in a Release.
Replace <version>[this]</version>
with the latest build found on the Jenkins page. See MemeratorAPI-[version string].jar.
<!-- Memerator API -->
<dependency>
<groupId>me.memerator.api</groupId>
<artifactId>MemeratorAPI</artifactId>
<version>[this]</version>
</dependency>
Builds remain there indefinitely, but it's always best to stay up to date.
Alternatively, on the same Jenkins link, you can manually download the JAR yourself for safe keeping, in case it does go down.
Using the API is simple. Here's an example to get you started!
import me.memerator.api.client.MemeratorAPIBuilder;
import me.memerator.api.client.entities.Meme;
import me.memerator.api.client.MemeratorAPI;
import me.memerator.api.internal.impl.MemeratorAPIImpl;
public class MyMemeratorProgram {
public static void main(String[] args) {
// Define the Memerator API
MemeratorAPI api = MemeratorAPIBuilder.create("your api key").build();
// Get meme "aaaaaaa"
Meme meme = api.retrieveMeme("aaaaaaa").complete();
// Print out the memerator.me link
System.out.println(meme.getMemeUrl());
}
}
You can view the Javadocs here.