No description
Find a file
ipsvn 5e7830f61c
Some checks failed
Build / gradle (push) Has been cancelled
Put newest version in Gradle dependency example
2024-03-27 00:48:26 +00:00
.github/workflows ok use that version i guess 2023-06-01 01:21:26 +01:00
example Initial commit 2023-02-02 18:00:05 +00:00
gradle/wrapper Initial commit 2023-02-02 18:00:05 +00:00
src well this is embarassing 2023-09-22 01:22:01 +01:00
.gitignore Initial commit 2023-02-02 18:00:05 +00:00
build.gradle.kts version 1.0.1 2023-09-26 21:10:09 +01:00
gradle.properties switch to gradle kotlin dsl, add maven publishing support and add maven download to readme 2023-06-03 18:14:57 +01:00
gradlew Initial commit 2023-02-02 18:00:05 +00:00
gradlew.bat Initial commit 2023-02-02 18:00:05 +00:00
LICENSE Initial commit 2023-02-02 18:00:05 +00:00
README.md Put newest version in Gradle dependency example 2024-03-27 00:48:26 +00:00
settings.gradle Initial commit 2023-02-02 18:00:05 +00:00

daily-reward-parse-util

Parses the Hypixel daily reward website into a basic Java API

Download

Releases are available on my maven repository at m2.svn.lol.

Gradle

repositories {
    maven {
        url = uri("https://m2.svn.lol/releases")
    }
}
dependencies {
    implementation("lol.svn:daily-reward-parse-util:1.0.1")
}

Examples

Use the library to take the ID, get the options and claim the first option

try (var reward = HypixelReward.fromId("abcd1234")) {
    reward.retrieveRewardOptions()
            .thenApply(response -> response.getOptions().get(0))
            .thenCompose(RewardOption::claim)
            .thenAccept(unused -> System.out.println("Claimed"))
}

Parse the HTML

var parseResult = RewardParser.parse(html);
System.out.println(parseResult.getSecurityToken());

The parser is an afterthought, so its more of just a 1:1 to the data JSON. You are able to convert the parse result if you have the CSRF cookie which comes from the cookie named _csrf from an HTTP response of the main page. An example of this:

var response = new RewardResponse(HypixelReward.fromId(parseResult.getId()), csrfCookie, parseResult);