- Supports Java 8 or later, Android (API level 24 or higher), JavaScript target.
- Supports all of Twitter's v1.1 public APIs and some v2 public and private APIs.
- All endpoint parameters can be represented by named parameters.
- There are model classes for response JSON, which can be accessed type-safely.
- Paging APIs can be handled by Flow.
Documentation is available at GitHub Pages.
Quick Example
suspend fun main() {
PenicillinClient {
account {
application("ConsumerKey", "ConsumerSecret")
token("AccessToken", "AccessToken Secret")
}
}.use { client ->
val timeline = client.timeline.userTimelineByScreenName(screenName = "POTUS", count = 100).execute()
timeline.forEach { status ->
println(status.text)
}
}
}
Other examples can be found at Wiki. If you have any questions, please let us know at Issue.
Get Started
Penicillin is now available in the Maven Central since version 6.1.0. The previous Bintray repository is no longer available.
Gradle
build.gradle.kts:
dependencies {
implementation("blue.starry:penicillin:$PenicillinVersion")
implementation("io.ktor:ktor-client-apache:1.6.8")
implementation("io.ktor:ktor-client-cio:1.6.8")
}
License
Penicillin is provided under the MIT license.
Copyright (c) 2017-2022 StarryBlueSky.