From d0b1f8c386bd1b61f7cbc6674ba3f78d450b7d47 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 24 Oct 2021 14:46:20 +0200 Subject: [PATCH] =?utf8?q?=E2=9C=A8=20Update=20Sinfest=20filter=20to=20cur?= =?utf8?q?rent=20HTML?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../filters/comics/SinfestComicFilter.java | 10 +- .../filters/comics/SinfestComicFilterTest.java | 6 +- .../rhynodge/filters/comics/sinfest.html | 603 ++++++++++++++------- 3 files changed, 427 insertions(+), 192 deletions(-) diff --git a/src/main/java/net/pterodactylus/rhynodge/filters/comics/SinfestComicFilter.java b/src/main/java/net/pterodactylus/rhynodge/filters/comics/SinfestComicFilter.java index f94c355..a370482 100644 --- a/src/main/java/net/pterodactylus/rhynodge/filters/comics/SinfestComicFilter.java +++ b/src/main/java/net/pterodactylus/rhynodge/filters/comics/SinfestComicFilter.java @@ -40,18 +40,12 @@ public class SinfestComicFilter extends ComicSiteFilter { @Override protected Optional extractTitle(Document document) { - Elements imageCell = selectImageAttributes(document); - return imageCell.hasAttr("alt") ? Optional.of(imageCell.attr("alt")) : Optional.absent(); + return Optional.fromNullable(document.select("tr.style5 td.style3").text()); } @Override protected List extractImageUrls(Document document) { - Elements imageCells = selectImageAttributes(document); - return imageCells.stream().map(cell -> cell.attr("src")).collect(Collectors.toList()); - } - - private Elements selectImageAttributes(Document document) { - return document.select("tbody.style5 img"); + return document.select("div.container img").stream().map(it -> it.attr("src")).collect(Collectors.toList()); } @Override diff --git a/src/test/java/net/pterodactylus/rhynodge/filters/comics/SinfestComicFilterTest.java b/src/test/java/net/pterodactylus/rhynodge/filters/comics/SinfestComicFilterTest.java index dc20d36..aee1142 100644 --- a/src/test/java/net/pterodactylus/rhynodge/filters/comics/SinfestComicFilterTest.java +++ b/src/test/java/net/pterodactylus/rhynodge/filters/comics/SinfestComicFilterTest.java @@ -30,8 +30,8 @@ public class SinfestComicFilterTest { private final HtmlState htmlState; public SinfestComicFilterTest() throws IOException { - Document document = ResourceLoader.loadDocument(SinfestComicFilter.class, "sinfest.html", "http://www.sinfest.net/"); - htmlState = new HtmlState("http://www.sinfest.net/", document); + Document document = ResourceLoader.loadDocument(SinfestComicFilter.class, "sinfest.html", "https://sinfest.xyz/"); + htmlState = new HtmlState("https://sinfest.xyz/", document); } @Test @@ -43,7 +43,7 @@ public class SinfestComicFilterTest { @Test public void imageUrlsAreParsedCorrectly() { ComicState comicState = (ComicState) sinfestFilter.filter(htmlState); - MatcherAssert.assertThat(comicState.comics(), Matchers.contains(matchesComic("Search 9", "http://www.sinfest.net/btphp/comics/2015-02-20.gif", ""))); + MatcherAssert.assertThat(comicState.comics(), Matchers.contains(matchesComic("October 24, 2021: Unperson 33", "https://sinfest.xyz/btphp/comics/2021-10-24.jpg", ""))); } private Matcher matchesComic(String title, String url, String comment) { diff --git a/src/test/resources/net/pterodactylus/rhynodge/filters/comics/sinfest.html b/src/test/resources/net/pterodactylus/rhynodge/filters/comics/sinfest.html index 9de933f..e60706a 100644 --- a/src/test/resources/net/pterodactylus/rhynodge/filters/comics/sinfest.html +++ b/src/test/resources/net/pterodactylus/rhynodge/filters/comics/sinfest.html @@ -1,9 +1,17 @@ - + + + + - + + + + + Sinfest - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - -
- - - - + -
-
-
- - - - - - - -
- By Tatsuya Ishida
+
- - - - -
HOME -  |  - ARCHIVE -  |  - FORUM -  |  - BOOKS -  |  - SEARCH

- - - - - - -
 - - - -
February 20, 2015: Search 9
Search 9
-
- -
+ +
-
-
-
+ +
+ + +
+ + +
+
-
- - - - -
- - - - - - -
-
-
+ + + +
+
+

-
- - - - -
- - - - - - - -
-
-
+
-
-
+ + + + +
+ +
+ + + +
October 24, 2021: Unperson 33
Unperson 33
+
+ +
+ + + + + +
+ + +

+ + + +
+ + + +
+
+ + + + + + + + + +
July 31, 2021
+
I'm A 21st Century Digital Boy
+
Posted by Tatsuya Ishida
+

Hi everyone.
+
+Sinfest is now mobile friendly. Please check out the archives on your mobile devices and let me know if there are any issues. Thanks!

+
+

+ + + + +
+ + + + + + +
+ + +
+ +
+ + +
+ + +
+ + +
+ + +
+
+
+ + + + + + + + + + + + + Header + + + + + + + + + + -
 - +
-
- -
+ +
- - - - + + +

+
-
-
- + + + -
- - -
-
- © COPYRIGHT 2000-2015 - BY TATSUYA - ISHIDA/MUSEWORKS. CONTACT -
- Powered by - - - btPHP 1.3.2
- -
page generated in 0.02347 seconds
-
-
+ + - - -
+ +
+ + + + + +
+ + +
+ + +
+ + +
+
+ - - - - + +
+
+ + + + +
+
+
\ No newline at end of file -- 2.7.4