All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.dankito.readability4j.extended.processor.PostprocessorExtended.kt Maven / Gradle / Ivy

Go to download

A Kotlin port of Mozilla‘s Readability. It extracts a website‘s relevant content and removes all clutter from it.

The newest version!
package net.dankito.readability4j.extended.processor

import net.dankito.readability4j.processor.Postprocessor
import org.jsoup.nodes.Element


open class PostprocessorExtended : Postprocessor() {

    override fun fixRelativeImageUri(img: Element, scheme: String, prePath: String, pathBase: String) {
        val dataSrc = img.attr("data-src") // load data-src;
        if(dataSrc.isNotBlank()) {
            img.attr("src", toAbsoluteURI(dataSrc, scheme, prePath, pathBase))
        }
        else {
            super.fixRelativeImageUri(img, scheme, prePath, pathBase)
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy