mirror of
https://github.com/jlengrand/OpenGraphKt.git
synced 2026-03-10 08:31:23 +00:00
12de34aa6091eae0212be2f14c56e248f242b772
* Update dependency com.fleeksoft.ksoup:ksoup-network to v0.2.5 (#40) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update whole ksoup to 0.2.5 * Update dependency gradle to v8.14.3 (#37) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency org.junit:junit-bom to v5.14.0 (#36) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency gradle to v8.14.3 (#43) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update plugin org.jetbrains.kotlin.jvm to v2.2.20 (#35) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update ktor from scraper * Update settings * Update settings * Update gradle/actions action to v4.4.4 (#31) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Adds claude init * Upgrades to Java 24 --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
OpenGraphKt
OpenGraphKt is a minimalist Kotlin multiplatform library to work with the Open Graph tags protocol. OpenGraphKt is a tiny wrapper on top of JSoup.
Current status
- Library can extract OpenGraph tags from HTML via a
URL,StringorFileinput. - Protocol implementation is complete for
og:tags, but types aren't fully correct (most types currently areString). - Library should be considered in pre-alpha, use this in production at your own risks :).
Usage
See Main.kt in the demo-remote submodule for usage examples.
In short :
- Add dependency to your Maven / Gradle file. For example :
implementation("fr.lengrand:opengraphkt:0.1.0")
- Enjoy:
val parser = Parser()
val openGraphDataDoc = parser.parse("https://www.imdb.com/title/tt0068646/")
println("Title: ${openGraphDataDoc.title}")
println("Is valid: ${openGraphDataDoc.isValid()}")
// Title: The Rock
// Is valid: true
Author
License
Languages
Kotlin
100%