Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/calne-ca/mal-api-java
MyAnimeList API Java Client
https://github.com/calne-ca/mal-api-java
anime animelist api api-client java java-client mal manga myanimelist myanimelist-api
Last synced: 2 months ago
JSON representation
MyAnimeList API Java Client
- Host: GitHub
- URL: https://github.com/calne-ca/mal-api-java
- Owner: calne-ca
- License: gpl-3.0
- Created: 2018-05-09T22:42:05.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-12-02T00:27:19.000Z (about 3 years ago)
- Last Synced: 2023-07-05T04:16:56.364Z (over 1 year ago)
- Topics: anime, animelist, api, api-client, java, java-client, mal, manga, myanimelist, myanimelist-api
- Language: Java
- Size: 51.8 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
## Java Client for MyAnimeList API (DEPRECATED)
### WARNING:
MyAnimeList has disabled their API as of May 2018, therefore this Java implementation doesn't work at the moment!### Usage
**Initializing the Client**
```java
MALClient client = new MALClient("username","password");
```**Verify Credentials**
```java
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**
```java
List animes = client.searchForAnime("Fate Kaleid");
animes.forEach(a -> System.out.println(a.getTitle()))
```**Searching for Manga**
```java
List mangas = client.searchForManga("Fate Zero");
mangas.forEach(m -> System.out.println(m.getTitle()))
```**Fetching AnimeList**
```java
AnimeList animeList = client.getAnimeList();
List entries = animeList.getEntries();
entries.forEach(e -> System.out.println(e.getSeriesTitle()))
```**Fetching MangaList**
```java
MangaList mangaList = client.getMangaList();
List entries = mangaList.getEntries();
entries.forEach(e -> System.out.println(e.getSeriesTitle()))
```**Adding Anime to AnimeList**
```java
AnimeListEntryValues values = new AnimeListEntryValues();
values.setStatus(AnimeListEntryStatus.WATCHING);
values.setEpisode(3);client.addToAnimeList(anime,values);
```**Adding Manga to MangaList**
```java
MangaListEntryValues values = new MangaListEntryValues();
values.setStatus(MangaListEntryStatus.READING);
values.setChapter(14);
values.setVolume(1);client.addToMangaList(manga,values);
```**Updating AnimeList**
```java
AnimeListEntryValues values = AnimeListEntryValues.from(entry);
values.setStatus(AnimeListEntryStatus.COMPLETED);client.updateAnimeList(entry,values);
```**Updating MangaList**
```java
MangaListEntryValues values = MangaListEntryValues.from(entry);
values.setStatus(MangaListEntryStatus.COMPLETED);client.updateMangaList(entry,values);
```**Removing Anime from AnimeList**
```java
client.removeFromAnimeList(entry);
```**Removing Manga from MangaList**
```java
client.removeFromMangaList(entry);
```### Maven Dependency
```xmlnet.beardbot
mal-api
1.0.1```