Priyansh-Kedia / OpenGraphParser

Open Graph Parser for Android
MIT License
85 stars 15 forks source link

Changes for builder pattern #25

Closed Priyansh-Kedia closed 11 months ago

Priyansh-Kedia commented 11 months ago

Fixes #22 #23 #24

@singpolyma, this pull request should fix all the three issues, specifying timeout, proxy and maxBodySize

You can use

    OpenGraphParser.Builder(listener = this)
        .cacheProvider(OpenGraphCacheProvider(this))
        .showNullOnEmpty(true)
        .maxBodySize(1000000)
        .timeout(1000000)
        .jsoupProxy(JsoupProxy("<host>", 8000))
        .build()

to create the instance of OGP. You can still use

    OpenGraphParser(
        listener = this,
        showNullOnEmpty = true,
        cacheProvider = OpenGraphCacheProvider(this)
    )

if there is not a need to specify other values.

I have tested this and is working as expected, can you confirm if all is working as expected?

Thanks

singpolyma commented 11 months ago

Instead of a new custom type JsoupProxy why not use the java.net.Proxy which jsoup does already support?

Priyansh-Kedia commented 11 months ago

Instead of a new custom type JsoupProxy why not use the java.net.Proxy which jsoup does already support?

Yes, that is because java.net and other packages are not available in Kotlin projects (Java 11). To avoid problems with any versions, we should keep external packages inside the lib code

singpolyma commented 11 months ago

Just tested this in my app and it seems to all work

Priyansh-Kedia commented 11 months ago

Just tested this in my app and it seems to all work

Great, thanks