https://github.com/magonxesp/zerochan-client
Zerochan API client for kotlin (https://www.zerochan.net/)
https://github.com/magonxesp/zerochan-client
api-client kotlin kotlin-android kotlin-jvm kotlin-library ktor-client zerochan
Last synced: 14 days ago
JSON representation
Zerochan API client for kotlin (https://www.zerochan.net/)
- Host: GitHub
- URL: https://github.com/magonxesp/zerochan-client
- Owner: magonxesp
- License: mit
- Created: 2024-02-13T11:07:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-16T10:45:01.000Z (over 1 year ago)
- Last Synced: 2025-05-24T01:47:14.909Z (about 1 month ago)
- Topics: api-client, kotlin, kotlin-android, kotlin-jvm, kotlin-library, ktor-client, zerochan
- Language: Kotlin
- Homepage:
- Size: 73.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Zerochan Client
Zerochan API client for kotlin
## Installation
Add the `kotlinx-coroutines-core` dependency from JetBrains and the zerochan client dependency to your `build.gradle.kts````kotlin
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_corroutines_version") // required
implementation("io.github.magonxesp:zerochan-client:1.0.0")
}
```## Usage
First you need to have a Zerochan account created, then you need to create a new instance of `ZerochanClient` class
and call a method.### Get by tag
Get items by one tag
```kotlin
import io.github.magonxesp.zerochanclient.ZerochanClientrunBlocking {
val client = ZerochanClient("", System.getenv("ZEROCHAN_USERNAME"))
val items = client.getByTag("Non non biyori") {
// you can limit the results and
page(1)
limit(15)
// sort by id
sort(Sort.ID)
// and more options, autocomplete with your IDE
}items.forEach { println(it.source) }
}
```### Get by tags
Get items by multiple tag
```kotlin
import io.github.magonxesp.zerochanclient.ZerochanClientrunBlocking {
val client = ZerochanClient("", System.getenv("ZEROCHAN_USERNAME"))
val items = client.getByTag(arrayOf("Non non biyori", "Genshin impact")) {
// you can limit the results and
page(1)
limit(15)
// sort by id
sort(Sort.ID)
// and more options, autocomplete with your IDE
}items.forEach { println(it.source) }
}
```### Get by id
Get a single item by id
```kotlin
import io.github.magonxesp.zerochanclient.ZerochanClientrunBlocking {
val client = ZerochanClient("", System.getenv("ZEROCHAN_USERNAME"))
val singleItem = client.getById(4114336)println(singleItem.large) // show the item image with large size
}
```