Warning
This library has been completely replaced by the more improved and better Kotlin-based library Amaririsu. You shouldn't use this library at all and instead prefer to use the above if needed.
Amatsuki is an asychronous simple text scraper for ScribbleHub built in Java, the main purpose for this library is to scrape public user data (bio, followed by x users, etc...) , or story data (synopsis, story title, thumbnail, etc...) from the https://scribblehub.com site.
If you wish to improve the library, please feel free to do so.
As of now, the only way to get this is through Jitpack which is still a simple way.
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>pw.mihou</groupId>
<artifactId>amatsuki</artifactId>
<version>Tag</version>
</dependency>
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'pw.mihou:amatsuki:Tag'
}
Amatsuki has a single class that has everything needed, this class is called Amatsuki
and all the methods are named after their use which should simplifies everything.
If you also want to, you can improve everything to your liking as I will only be using this for the basic tasks.
All the results here will return back an CompletableFuture which will either contain the value or not.
new Amatsuki().searchStory("A Dream Foretold");
new Amatsuki().searchUser("Mihou");
new Amatsuki().getUserFromUrl("https://www.scribblehub.com/profile/24680/mihou/");
new Amatsuki().getStoryFromUrl("https://www.scribblehub.com/series/193852/a-dream-foretold/");
new Amatsuki().getTrending(); // Gets the trending (daily).
new Amatsuki().getTrending(OrderBy.WEEKLY); // Gets the weekly trending.
new Amatsuki().getLatestSeries(); // latest series.
new Amatsuki().getLatestUpdates(); // latest updates.
new Amatsuki().getCertainRankings();
new Amatsuki().getCertainRankings(Rankings.ACTIVITY, OrderBy.WEEKLY); // This will get the Activity Rankings, ordered by weekly.
new Amatsuki().getCertainRankings(Rankings.ACTIVITY); // Exactly the same as the first one except this uses the default order (Daily).
new Amatsuki().searchUser("Mihou", 30000); // Timeout is in millis.
// Explanation:
// IncludeGenre - as the name implies, includes (a) genre(s) to the search, the opposite of this is ExcludeGenre.
// SetSorting - sets the sorting method for the stories, whether it be Reader count or etc.
// SetStoryStatus - include only specific story status, by default it is StoryStatus.ALL.
// ExcludeGenreBy - (this also applies to inclusion), sets whether to exclude, or include the genres through OR or AND (like exclude several genres at once, or etc...).
// SetAscending - assists in sorting whether it'd be ascending or descending.
// Build - will build the URL then call, AmatsukiConnector's method to send the results.
new SearchFinder().includeGenre(Genre.GIRLS_LOVE, Genre.SLICE_OF_LIFE).setSorting(SortBy.READERS).setStoryStatus(StoryStatus.COMPLETED).excludeGenreBy(ExclusionMethod.OR).setAscending(true).build()