Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

drakon64/KtLodestone

Repository files navigation

KtLodestone

Kotlin Beta Kotlin License Quality Gate Status

KtLodestone is a parser for The Lodestone for the JVM platform (JDK 8+).

Features


  • Supports scraping the following information from The Lodestone:
    • Character
      • Profile
      • Class/job
      • Minions
      • Mounts
      • Achievements
    • Linkshells
    • Search
      • Characters
      • Linkshells
      • Free Companies
  • Compatible with Kotlin and Java
    • Kotlin functions are suspendable
    • Java-compatible functions return a CompletableFuture

Installation


KtLodestone is available from Maven Central:

dependencies {
    implementation("cloud.drakon.ktlodestone:7.0.0-SNAPSHOT")
}

Documentation


Kotlin KDocs: kdoc
Javadocs: javadoc

Examples


Getting information about a Lodestone character

Kotlin:

val character: CharacterProfile = getLodestoneCharacter(27545492) // Must be called from a coroutine or a suspendable function
val activeClassJob: ClassJob = character.activeClassJob.classJob // returns `ClassJob.RED_MAGE`
val activeClassJob: String = character.activeClassJob.classJob.toString() // returns "Red Mage"
val activeClassJobLevel: Byte = character.activeClassJob.level // returns `90`
val title: String = character.title // returns "Hope's Legacy"

Java:

CharacterProfile character = KtLodestone.getCharacter(27545492).get(); // Async functions return a `CompletableFuture`
ClassJob activeClassJob = character.getActiveClassJob().getClassJob(); // returns `ClassJob.RED_MAGE`
String activeClassJobName = character.getActiveClassJob().getClassJob().toString(); // returns "Red Mage"
Byte activeClassJobLevel = character.getActiveClassJob().getLevel(); // returns `90`
String title = character.getTitle(); // returns "Hope's Legacy"