You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

blue.starry:penicillin

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blue.starry:penicillin

Full-featured Twitter API wrapper for Kotlin


Version published
Maintainers
1

Readme

Source

Penicillin: Modern powerful Twitter API wrapper for Kotlin Multiplatform

Kotlin GitHub release (latest by date) GitHub Workflow Status license issues pull requests

  • 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() {
    // Create new PenicillinClient.
    PenicillinClient {
        account {
            application("ConsumerKey", "ConsumerSecret")
            token("AccessToken", "AccessToken Secret")
        }
    }.use { client ->
        // Retrieve up to 100 tweets from @POTUS.
        val timeline = client.timeline.userTimelineByScreenName(screenName = "POTUS", count = 100).execute()

        // The return value of the timeline is `JsonArrayResponse<Status>`. It implements `Iterable<T>`, which allows iterative operations.
        timeline.forEach { status ->
            // Print unescaped status text. If you want to get the raw html reference characters, you can use `textRaw`.
            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.

GitHub release (latest by date)

Gradle

build.gradle.kts:
dependencies {
    implementation("blue.starry:penicillin:$PenicillinVersion")
    
    // Choose your favorite engine from https://ktor.io/clients/http-client/engines.html
    // The version should match the version of Ktor that Penicillin is using.
    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.

FAQs

Package last updated on 13 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc