Code Monkey home page Code Monkey logo

aghpb4j's Introduction

โ˜• AGHPB4J ๐Ÿ“š

Java Wrapper for the anime girls holding programming books API.

GitHub Release

Note

I am not the original author of the AGHPB API. You can view their Wrappers for other Languages here.

This Wrapper is based on the AGHPB API. It is a simple Java Wrapper that allows you to interact with the API in a more convenient way.

Installation

To use this Wrapper, you need to add the following repository and dependency to your pom.xml file. Replace VERSION with the latest version seen above or found here.

<repositories>
    <repository>
        <id>joshicodes-de-releases</id>
        <name>JoshiCodes Repository</name>
        <url>https://repo.joshicodes.de/releases</url>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>de.joshicodes</groupId>
        <artifactId>AGHPB4J</artifactId>
        <version>VERSION</version>
    </dependency>
</dependencies>

Usage

To use the API, you first need to create a new AGHPB object. You can do this by calling the constructor and passing the URL of the API as a parameter.

AGHPB aghpb = new AGHPB("http://localhost:5000");
// If no url is provided, the default public api will be used (https://api.devgoldy.xyz/aghpb/v1/)
AGHPB aghpb = new AGHPB();

After creating the object, just use one of the available methods. Almost every method, returns a RestAction Object. To execute the request, you need to call the #execute() method. This method is blocking and will return the result. If you want to execute the request asynchronously, you can use the #queue() method. This method will return void, but can take a Consumer as a parameter, which will be called when the request is completed.

AGHPB aghpb = new AGHPB();


AGHPBook book = aghpb.retrieveRandomImage().execute(); // Blocking
System.out.println(book.getUrl());
// or
aghpb.retrieveRandomImage().queue(book -> System.out.println(book.getUrl())); // Asynchronous

For more examples, see here.

Methods

  • AGHPB#retrieveStatus() - ApiStatus Returns the status of the API.
  • AGHPB#retrieveInfo() - ApiInfo Returns the info of the API.
  • AGHPB#retrieveAllCategories() - List<String> Returns a list of all available categories.
  • AGHPB#retrieveRandomImage(@Nullable String category, @Nullable AGHPBook.BookImageType type) - AGHPBook Returns a random image. Both parameters are optional and alternatively you can use the AGHPB#retrieveRandomImage() method without parameters or with only one parameter.
  • AGHPB#retrieveSearch(String query) - List<AGHPBook> Returns a list of images that match the search query. Alternatively you can use AGHPB#retrieveSearch(String query, int limit), AGHPB#retrieveSearch(String query, int limit, int page) or AGHPB#retrieveSearch(String query, String category) or AGHPB#retrieveSearch(String query, String category, int limit).
  • AGHPB#retrieveBook(int searchId) - AGHPBook Returns a book by its search id. Alternatively you can provide a BookImageType to specify the type of the image. Instead of the searchId, you can also provide an unfinished AGHPBook object, to retrieve its image.

You can find the full JavaDocs here.

aghpb4j's People

Contributors

joshicodes avatar

Stargazers

Goldy avatar  avatar

Watchers

 avatar

aghpb4j's Issues

Values not final

There are a lot of values and fields, which could be final but are not

No difference on performance or anything, but should be implemented

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.