Coder Social home page Coder Social logo

mal-api-java's Introduction

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

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>

mal-api-java's People

Contributors

calne-ca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mal-api-java's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.