Showcase
このページには slashnephy.icon の主な成果物を書いていきます
Kotlin
Twitter API wrapper written in Kotlin/Multiplatform. Works on JVM, JS (Browser, NodeJS).
code:main.kt
suspend fun main() {
PenicillinClient {
account {
application("ConsumerKey", "ConsumerSecret")
token("AccessToken", "AccessToken Secret")
}
}.use { client ->
client.timeline.userTimelineByScreenName(
screenName = "twitter",
count = 100
).execute().forEach { status ->
println(status.text)
}
}
}
Json bindings for Kotlin/Multiplatform. This project is used in Penicillin.
委譲プロパティを使って、直感的に JSON を Kotlin のクラスに変換できるのが特徴です。
code:main.kt
data class Model(override val json: JsonObject): JsonModel {
val a by int
val b by float
val c by string
val d by intList
val e by model { E(it) }
val f by modelList { E(it) }
data class E(override val json: JsonObject): JsonModel {
val x by nullableString
val y by double
val z by int
}
}
private val json = """{
"a": 1,
"b": 2.3,
"c": "hoge",
"e": {
"x": "1",
"y": 2.0,
"z": 3
},
"f": [
{
"x": "1",
"y": 2.0001,
"z": 3
},
{
"x": null,
"y": 20.00001,
"z": 30
}
]
}"""
fun main() {
val model = json.parseObject { Model(it) }
println(model.a == 1) // true
}
もうメンテしてない
#Kotlin VRChat Web API wrapper written in Kotlin. Currently working in progress. #Kotlin A simple substitute implementation for the Twitter UserStream. #Python Easy bot Framework supporting Twitter & Discord. #Python A Lightweight & Full Powered Twitter API Wrapper.