⬆️ Update Jsoup dependency
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 9 Feb 2024 22:00:55 +0000 (23:00 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 9 Feb 2024 22:00:55 +0000 (23:00 +0100)
build.gradle
src/main/kotlin/net/pterodactylus/rhynodge/filters/comics/OglafComicSiteFilter.kt
src/main/kotlin/net/pterodactylus/rhynodge/filters/comics/QuestionableContentComicFilter.kt
src/main/kotlin/net/pterodactylus/rhynodge/filters/comics/SoggyCardboardComicFilter.kt
src/test/java/net/pterodactylus/rhynodge/filters/comics/ChiefOBrienAtWorkComicFilterTest.java

index e195ee3..55bd153 100644 (file)
@@ -40,7 +40,7 @@ dependencies {
     compile group: "com.google.guava", name: "guava", version: "14.0-rc1"
     compile group: "log4j", name: "log4j", version: "1.2.17"
     compile group: "org.apache.httpcomponents", name: "httpclient", version: "4.4"
-    compile group: "org.jsoup", name: "jsoup", version: "1.7.1"
+    compile group: "org.jsoup", name: "jsoup", version: "1.16.1"
     compile group: "javax.mail", name: "mail", version: "1.4.6-rc1"
     compile group: "org.apache.commons", name: "commons-lang3", version: "3.1"
     compile group: "com.fasterxml.jackson.core", name: "jackson-core", version: "2.1.2"
index 777eca8..c886fca 100644 (file)
@@ -9,12 +9,12 @@ class OglafComicSiteFilter : ComicSiteFilter() {
        override fun extractTitle(document: Document) = document.title().asOptional()
 
        override fun extractImageUrls(document: Document) =
-               document.getElementById("strip")
+               document.getElementById("strip")!!
                        .attr("src")
                        .let(::listOf)
 
        override fun extractImageComments(document: Document) =
-               document.getElementById("strip")
+               document.getElementById("strip")!!
                        .attr("title")
                        .let(::listOf)
 
index 5b56df7..f405839 100644 (file)
@@ -25,7 +25,7 @@ class QuestionableContentComicFilter : ComicSiteFilter() {
        override fun extractTitle(document: Document): Optional<String> = Optional.absent()
 
        override fun extractImageUrls(document: Document): List<String> =
-                       listOf(document.select("#comicnav").first().nextSibling().nextSibling().attr("src"))
+                       listOf(document.select("#comicnav").first()!!.nextSibling()!!.nextSibling()!!.attr("src"))
 
        override fun extractImageComments(document: Document): List<String> = emptyList()
 
index d779a9c..5da7106 100644 (file)
@@ -8,7 +8,7 @@ import org.jsoup.nodes.Document
 class SoggyCardboardComicFilter : ComicSiteFilter() {
 
        override fun extractTitle(document: Document): Optional<String> =
-                       document.select(".ceo_latest_comics_widget li").first().text().asOptional()
+                       document.select(".ceo_latest_comics_widget li").first()!!.text().asOptional()
 
        override fun extractImageUrls(document: Document): List<String> =
                        listOf(document.select("#comic img").attr("src"))
index bd32ed2..041838d 100644 (file)
@@ -36,7 +36,7 @@ public class ChiefOBrienAtWorkComicFilterTest {
 
        @Test
        public void filterCanParseComicTitles() {
-               MatcherAssert.assertThat(filter.extractTitle(document), Matchers.is(Optional.of("EPISODE 60: Being Human\u00a0")));
+               MatcherAssert.assertThat(filter.extractTitle(document), Matchers.is(Optional.of("EPISODE 60: Being Human")));
        }
 
 }