Compare commits

..

10 Commits

Author SHA1 Message Date
jetbrains-junie[bot]
038a0e8d56 feat(junie): added .devcontainer.json 2025-06-02 21:53:32 +00:00
jetbrains-junie[bot]
3b2ba27c80 feat(junie): added .junie workflow 2025-06-02 21:53:31 +00:00
renovate[bot]
11a22550b7 Update dependency gradle to v8.14.1 (#23)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-02 23:35:45 +02:00
renovate[bot]
41b06172a9 Update plugin org.gradle.toolchains.foojay-resolver-convention to v1 (#21)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-20 09:12:58 +02:00
Julien Lengrand-Lambert
e86142c2f0 Can be better, but gives an impression of the library size 2025-05-19 13:55:06 +02:00
Julien Lengrand-Lambert
291f9cd8e1 Adds usage to README 2025-05-19 13:52:04 +02:00
Julien Lengrand-Lambert
88c9b155f5 Updates README 2025-05-19 13:46:13 +02:00
julien Lengrand-Lambert
95069c10a3 Uploading Code Coverage info (#20)
* Setting up Kover
* Adding CodeCov setup
* Adding badge
2025-05-19 12:30:15 +02:00
julien Lengrand-Lambert
20f206755c Merge pull request #19 from jlengrand/feat/kover
Adding Code Coverage information
2025-05-19 10:12:08 +02:00
Julien Lengrand-Lambert
49dae0504d Updates demo-remote 2025-05-18 22:49:42 +02:00
7 changed files with 72 additions and 12 deletions

View File

@@ -0,0 +1,12 @@
{
"name": "Java",
"image": "mcr.microsoft.com/devcontainers/java:1-21",
"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "none",
"installMaven": "true",
"mavenVersion": "3.8.6",
"installGradle": "true"
}
}
}

22
.github/workflows/junie.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: Junie
run-name: Junie run ${{ inputs.run_id }}
permissions:
contents: write
pull-requests: write
on:
workflow_dispatch:
inputs:
run_id:
description: "id of workflow process"
required: true
workflow_params:
description: "stringified params"
required: true
jobs:
call-workflow-passing-data:
uses: jetbrains-junie/junie-workflows/.github/workflows/ej-issue.yml@main
with:
workflow_params: ${{ inputs.workflow_params }}

View File

@@ -6,15 +6,44 @@
![Maven Central Version](https://img.shields.io/maven-central/v/fr.lengrand/opengraphkt)
![kotlin-version](https://img.shields.io/badge/kotlin-2.1.0-blue?logo=kotlin)
![GitHub License](https://img.shields.io/github/license/jlengrand/OpenGraphKt)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/jlengrand/OpenGraphKt)
[OpenGraphKt](https://github.com/jlengrand/OpenGraphKt) is a minimalist Kotlin library to work with the [Open Graph tags](https://ogp.me/) protocol.
OpenGraphKt is a tiny wrapper on top of JSoup.
OpenGraphKt is a tiny wrapper on top of JSoup.
## Current status
* WIP and absolutely not ready for production usage.
* Implementation missing the music, video and audio verticals (see https://ogp.me/)
* 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](./demo-remote/src/main/kotlin/fr/lengrand/opengraphktremote/Main.kt) in the `demo-remote` submodule for usage examples.
In short :
* Add dependency to your Maven / Gradle file. For example :
```bash
implementation("fr.lengrand:opengraphkt:0.0.2")
```
* Enjoy:
```kotlin
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

View File

@@ -10,8 +10,7 @@ repositories {
}
dependencies {
implementation("org.jsoup:jsoup:1.20.1")
implementation("fr.lengrand:opengraphkt:0.0.1")
implementation("fr.lengrand:opengraphkt:0.0.2")
testImplementation(kotlin("test"))
}

View File

@@ -1,13 +1,12 @@
package fr.lengrand.opengraphktremote
import fr.lengrand.opengraphkt.OpenGraphParser
import org.jsoup.Jsoup
import fr.lengrand.opengraphkt.Parser
/**
* This module is only here to verify that the latest Maven Central release can be imported and used as intended.
*/
fun main() {
val parser = OpenGraphParser()
val parser = Parser()
val html = """
<!DOCTYPE html>
@@ -31,8 +30,7 @@ fun main() {
println("Parsing from JSoup Document")
val doc = Jsoup.parse(html)
val openGraphDataDoc = parser.parse(doc)
val openGraphDataDoc = parser.parse(html)
println("Title: ${openGraphDataDoc.title}")
println("Is valid: ${openGraphDataDoc.isValid()}")

View File

@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

View File

@@ -4,7 +4,7 @@ pluginManagement {
}
}
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.10.0"
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
}
rootProject.name = "OpenGraphKt"
include("opengraphkt")