Julien Lengrand-Lambert 291f9cd8e1 Adds usage to README
2025-05-19 13:52:04 +02:00
2025-05-18 14:48:27 +02:00
2025-05-18 22:49:42 +02:00
2025-05-01 10:43:24 +02:00
2025-05-16 22:06:02 +02:00
2025-05-01 10:43:24 +02:00
2025-05-16 21:15:47 +00:00
2025-05-16 21:15:47 +00:00
2025-05-01 11:19:16 +02:00
2025-05-19 13:52:04 +02:00

OpenGraphKt

build Codecov GitHub Release Date Maven Central Version kotlin-version GitHub License

OpenGraphKt is a minimalist Kotlin 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, String or File input.
  • Current implementation is JVM only, due to the JSoup dependency.
  • Protocol implementation is complete for og: tags, but types aren't fully correct (most types currently are String).
  • 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.0.2")
  • 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

Dependencies

Author

License

Description
No description provided
Readme MIT 2.6 MiB
Languages
Kotlin 100%