Unofficial Kotlin driver for the unjs/ungh api
Gradle (Kotlin)
dependencies {
implementation("dev.gradienttim", "ungh-kt", "VERSION")
}
Gradle (Groovy)
dependencies {
implementation "dev.gradienttim:ungh-kt:VERSION"
}
Maven
<dependencies>
<dependency>
<groupId>dev.gradienttim</groupId>
<artifactId>ungh-kt</artifactId>
<version>VERSION</version>
</dependency>
</dependencies>
These are just a few examples of how to use the library.
In theUngh
class you will find more functions to use all the features provided by theunjs/ungh
api
val repository = Ungh.repository("unjs", "ungh")
if (repository == null) {
println("unjs/ungh repository not found :/")
}
val organization = Ungh.organization("unjs")
organization?.let {
println("Organization description: ${it.description}")
}
// val stars = Ungh.stars("GradientTim/ungh-kt") // single repo
val stars = Ungh.stars(listOf(
"unjs/ungh",
"Jetbrains/Kotlin",
"GradientTim/ungh-kt",
))
stars?.let {
println("Total stars: ${it.totalStars}")
it.stars.forEach { (key, value) ->
println("$key has $value stars")
}
}
val user = Ungh.user("GradientTim")
user?.let {
println("Did you know that his name is ${it.name}?")
}
This project is licensed under the MIT license