X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Frhynodge%2Ffilters%2Fcomics%2FSaturdayMorningBreakfastCerealComicFilter.java;h=7f4bc1518633caf1b2bcdb709732388b17baad10;hb=cf2f4441705f9a5941022fb0837d08c95a1d0633;hp=6a9b73a3ec97be84646de465e4559b6403cc1c90;hpb=5bf8e42840cbb9a3d063b07d7e17b723331296dc;p=rhynodge.git
diff --git a/src/main/java/net/pterodactylus/rhynodge/filters/comics/SaturdayMorningBreakfastCerealComicFilter.java b/src/main/java/net/pterodactylus/rhynodge/filters/comics/SaturdayMorningBreakfastCerealComicFilter.java
index 6a9b73a..7f4bc15 100644
--- a/src/main/java/net/pterodactylus/rhynodge/filters/comics/SaturdayMorningBreakfastCerealComicFilter.java
+++ b/src/main/java/net/pterodactylus/rhynodge/filters/comics/SaturdayMorningBreakfastCerealComicFilter.java
@@ -29,7 +29,8 @@ import com.google.common.collect.FluentIterable;
import org.jsoup.nodes.Document;
/**
- * TODO
+ * {@link ComicSiteFilter} implementation that can parse Saturday Morning
+ * Breakfast Cereal.
*
* @author David âBombeâ Roden
*/
@@ -42,20 +43,15 @@ public class SaturdayMorningBreakfastCerealComicFilter extends ComicSiteFilter {
@Override
protected List extractImageUrls(Document document) {
- String imageUrl = document.select(".comicboxcenter img:eq(1)").attr("src");
+ String imageUrl = document.select("img#cc-comic").get(0).attr("src");
String afterImageUrl = document.select("#aftercomic img").attr("src");
- return FluentIterable.from(Arrays.asList(imageUrl, afterImageUrl)).filter(new Predicate() {
-
- @Override
- public boolean apply(String url) {
- return url.length() > 0;
- }
- }).toList();
+ return FluentIterable.from(Arrays.asList(imageUrl, afterImageUrl)).filter(url -> url.length() > 0).toList();
}
@Override
protected List extractImageComments(Document document) {
- return Collections.emptyList();
+ String imageComment = document.select("img#cc-comic").get(0).attr("title");
+ return Arrays.asList(imageComment, "");
}
}