From: David ‘Bombe’ Roden Date: Fri, 8 Mar 2024 14:50:14 +0000 (+0100) Subject: 🐛 Fix Chief O’Brian at Work filter X-Git-Tag: v2~9 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=92569ecab7f1761822bbf45fbf3e0a5a2ba69003;p=rhynodge.git 🐛 Fix Chief O’Brian at Work filter --- diff --git a/src/main/java/net/pterodactylus/rhynodge/filters/comics/ChiefOBrienAtWorkComicFilter.java b/src/main/java/net/pterodactylus/rhynodge/filters/comics/ChiefOBrienAtWorkComicFilter.java index 8ec8e21..5671bc4 100644 --- a/src/main/java/net/pterodactylus/rhynodge/filters/comics/ChiefOBrienAtWorkComicFilter.java +++ b/src/main/java/net/pterodactylus/rhynodge/filters/comics/ChiefOBrienAtWorkComicFilter.java @@ -19,7 +19,7 @@ public class ChiefOBrienAtWorkComicFilter extends ComicSiteFilter { @Override protected List extractImageUrls(Document document) { - return Arrays.asList(document.select(".P .P-H .larger-width img").get(0).attr("src")); + return Arrays.asList(document.select("article a img.image").get(0).attr("src")); } @Override @@ -29,7 +29,7 @@ public class ChiefOBrienAtWorkComicFilter extends ComicSiteFilter { @Override protected Optional extractTitle(Document document) { - return Optional.fromNullable(document.select(".P-post .captions p").get(0).text()); + return Optional.fromNullable(document.select("article .caption p").get(0).text()); } } diff --git a/src/test/kotlin/net/pterodactylus/rhynodge/filters/comics/ChiefOBrienAtWorkComicFilterTest.kt b/src/test/kotlin/net/pterodactylus/rhynodge/filters/comics/ChiefOBrienAtWorkComicFilterTest.kt index 61d5c31..d5a44b8 100644 --- a/src/test/kotlin/net/pterodactylus/rhynodge/filters/comics/ChiefOBrienAtWorkComicFilterTest.kt +++ b/src/test/kotlin/net/pterodactylus/rhynodge/filters/comics/ChiefOBrienAtWorkComicFilterTest.kt @@ -16,7 +16,7 @@ class ChiefOBrienAtWorkComicFilterTest { @Test fun `image url is parsed correctly`() { - assertThat(filter.extractImageUrls(document), contains("http://41.media.tumblr.com/db92f4218b8a100f216863ce980e19a9/tumblr_njaewe7vNU1tjd8fao1_1280.jpg")) + assertThat(filter.extractImageUrls(document), contains("https://64.media.tumblr.com/232470107c558ea4e1d37813fe2d083b/3bf229ad9e15b880-85/s2048x3072/a001c59dd84c4961266fd9e9574dc0ff497e1946.jpg")) } @Test @@ -26,7 +26,7 @@ class ChiefOBrienAtWorkComicFilterTest { @Test fun `comic titles are parsed correctly`() { - assertThat(filter.extractTitle(document), equalTo(Optional.of("EPISODE 60: Being Human"))) + assertThat(filter.extractTitle(document), equalTo(Optional.of("EPISODE 384: So Sorry"))) } private val filter = ChiefOBrienAtWorkComicFilter() diff --git a/src/test/resources/net/pterodactylus/rhynodge/filters/comics/chief-obrien-at-work.html b/src/test/resources/net/pterodactylus/rhynodge/filters/comics/chief-obrien-at-work.html index cb0485c..ab30189 100644 --- a/src/test/resources/net/pterodactylus/rhynodge/filters/comics/chief-obrien-at-work.html +++ b/src/test/resources/net/pterodactylus/rhynodge/filters/comics/chief-obrien-at-work.html @@ -1,371 +1,610 @@ - - - - - - - - - -CHIEF O'BRIEN AT WORK - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CHIEF O'BRIEN AT WORK
From the man who brought you Chief O’Brien after Star Trek brought you Chief O’Brien,
comes a comic for fans of space travel, dead-end jobs, and ennui.
- - - - -
- -
- -
- -
- - - - - - - - - - - - - - - -
- - - -
- - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + CHIEF O'BRIEN AT WORK + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

+ + + + CHIEF O'BRIEN AT WORK + + + + + + +

+
+ + + +
+ +
+
+ + + + + + + + + + +
+ + + + + + + + + +
+ + + + + + + +
+ + + +
+ + + + + + + +
+ +
+ + +
+ + + + + +