projects
/
rhynodge.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
🎨 Replace QC watcher with Kotlin version
[rhynodge.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
rhynodge
/
filters
/
comics
/
SaturdayMorningBreakfastCerealComicFilter.java
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
(file)
--- 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;
/**
import org.jsoup.nodes.Document;
/**
- * TODO
+ * {@link ComicSiteFilter} implementation that can parse Saturday Morning
+ * Breakfast Cereal.
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
@@
-42,20
+43,15
@@
public class SaturdayMorningBreakfastCerealComicFilter extends ComicSiteFilter {
@Override
protected List<String> extractImageUrls(Document document) {
@Override
protected List<String> 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");
String afterImageUrl = document.select("#aftercomic img").attr("src");
- return FluentIterable.from(Arrays.asList(imageUrl, afterImageUrl)).filter(new Predicate<String>() {
-
- @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<String> extractImageComments(Document document) {
}
@Override
protected List<String> extractImageComments(Document document) {
- return Collections.emptyList();
+ String imageComment = document.select("img#cc-comic").get(0).attr("title");
+ return Arrays.asList(imageComment, "");
}
}
}
}