net.beardbot:mal-api

Java binding for the official MyAnimeList API

License

License

Categories

Categories

Net
GroupId

GroupId

net.beardbot
ArtifactId

ArtifactId

mal-api
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

net.beardbot:mal-api
Java binding for the official MyAnimeList API
Project URL

Project URL

https://github.com/calne-ca/mal-api-java
Source Code Management

Source Code Management

https://github.com/calne-ca/mal-api-java

Download mal-api

How to add to project

<!-- https://jarcasting.com/artifacts/net.beardbot/mal-api/ -->
<dependency>
    <groupId>net.beardbot</groupId>
    <artifactId>mal-api</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/net.beardbot/mal-api/
implementation 'net.beardbot:mal-api:1.0.1'
// https://jarcasting.com/artifacts/net.beardbot/mal-api/
implementation ("net.beardbot:mal-api:1.0.1")
'net.beardbot:mal-api:jar:1.0.1'
<dependency org="net.beardbot" name="mal-api" rev="1.0.1">
  <artifact name="mal-api" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.beardbot', module='mal-api', version='1.0.1')
)
libraryDependencies += "net.beardbot" % "mal-api" % "1.0.1"
[net.beardbot/mal-api "1.0.1"]

Dependencies

compile (11)

Group / Artifact Type Version
org.glassfish.jersey.core : jersey-common jar 2.27
org.glassfish.jersey.inject : jersey-hk2 jar 2.27
org.glassfish.jersey.connectors : jersey-apache-connector jar 2.27
org.glassfish.jersey.core : jersey-client jar 2.27
org.glassfish.jersey.media : jersey-media-moxy jar 2.27
org.glassfish.jersey.media : jersey-media-jaxb jar 2.27
org.apache.commons : commons-lang3 jar 3.0
commons-io : commons-io jar 2.5
org.slf4j : slf4j-api jar 1.7.25
org.slf4j : slf4j-simple jar 1.7.25
org.projectlombok : lombok jar 1.16.20

test (5)

Group / Artifact Type Version
com.github.tomakehurst : wiremock jar 1.57
org.hamcrest : hamcrest-all jar 1.3
org.mockito : mockito-core jar 1.10.19
junit : junit jar 4.12
me.alexpanov : free-port-finder jar 1.0

Project Modules

There are no modules declared in this project.

Java Client for MyAnimeList API

WARNING:

MyAnimeList has disabled their API as of May 2018, therefore this Java implementation doesn't work at the moment!

Usage

Initializing the Client

MALClient client = new MALClient("username","password");

Verify Credentials

try {
    User user = client.verifyCredentials();
    System.out.println("Verified user with id: " + user.getId());
} catch(NotAuthorizedException e) {
    System.err.println("The provided credentials are invalid!");
}

Searching for Anime

List<Anime> animes = client.searchForAnime("Fate Kaleid");
animes.forEach(a -> System.out.println(a.getTitle()))

Searching for Manga

List<Manga> mangas = client.searchForManga("Fate Zero");
mangas.forEach(m -> System.out.println(m.getTitle()))

Fetching AnimeList

AnimeList animeList = client.getAnimeList();
List<AnimeEntry> entries = animeList.getEntries();
entries.forEach(e -> System.out.println(e.getSeriesTitle()))

Fetching MangaList

MangaList mangaList = client.getMangaList();
List<MangaEntry> entries = mangaList.getEntries();
entries.forEach(e -> System.out.println(e.getSeriesTitle()))

Adding Anime to AnimeList

AnimeListEntryValues values = new AnimeListEntryValues();
values.setStatus(AnimeListEntryStatus.WATCHING);
values.setEpisode(3);

client.addToAnimeList(anime,values);

Adding Manga to MangaList

MangaListEntryValues values = new MangaListEntryValues();
values.setStatus(MangaListEntryStatus.READING);
values.setChapter(14);
values.setVolume(1);

client.addToMangaList(manga,values);

Updating AnimeList

AnimeListEntryValues values = AnimeListEntryValues.from(entry);
values.setStatus(AnimeListEntryStatus.COMPLETED);

client.updateAnimeList(entry,values);

Updating MangaList

MangaListEntryValues values = MangaListEntryValues.from(entry);
values.setStatus(MangaListEntryStatus.COMPLETED);

client.updateMangaList(entry,values);

Removing Anime from AnimeList

client.removeFromAnimeList(entry);

Removing Manga from MangaList

client.removeFromMangaList(entry);

Maven Dependency

<dependency>
    <groupId>net.beardbot</groupId>
    <artifactId>mal-api</artifactId>
    <version>1.0.1</version>
</dependency>

Versions

Version
1.0.1
1.0.0