public class AbstruseGooseWatcher extends DefaultWatcher {
public AbstruseGooseWatcher() {
- super(new HttpQuery("http://abstrusegoose.com/"), Arrays.asList(new HtmlFilter(), new AbstruseGooseComicFilter()), new ComicMerger());
+ super(new HttpQuery("https://abstrusegoose.com/"), Arrays.asList(new HtmlFilter(), new AbstruseGooseComicFilter()), new ComicMerger());
}
}
/** Creates a new watcher for Cyanide and Happiness comics. */
public CtrlAltDelWatcher() {
- super(new HttpQuery("http://www.cad-comic.com/cad/"), Arrays.asList(new HtmlFilter(), new CtrlAltDelComicFilter()), new ComicMerger());
+ super(new HttpQuery("https://cad-comic.com/"), Arrays.asList(new HtmlFilter(), new CtrlAltDelComicFilter()), new ComicMerger());
}
}
/** Creates a new watcher for Cyanide and Happiness comics. */
public CyanideAndHappinessWatcher() {
- super(new HttpQuery("http://www.explosm.net/comics/new/"), Arrays.asList(new HtmlFilter(), new CyanideAndHappinessComicFilter()), new ComicMerger());
+ super(new HttpQuery("https://explosm.net/"), Arrays.asList(new HtmlFilter(), new CyanideAndHappinessComicFilter()), new ComicMerger());
}
}
/** Creates a new watcher for Cyanide and Happiness comics. */
public GeneralProtectionFaultWatcher() {
- super(new HttpQuery("http://www.gpf-comics.com/"), Arrays.asList(new HtmlFilter(), new GeneralProtectionFaultComicFilter()), new ComicMerger());
+ super(new HttpQuery("https://www.gpf-comics.com/"), Arrays.asList(new HtmlFilter(), new GeneralProtectionFaultComicFilter()), new ComicMerger());
}
}
/** Creates a new watcher for Cyanide and Happiness comics. */
public GirlGeniusWatcher() {
- super(new HttpQuery("http://www.girlgeniusonline.com/comic.php"), Arrays.asList(new HtmlFilter(), new GirlGeniusComicFilter()), new ComicMerger());
+ super(new HttpQuery("https://www.girlgeniusonline.com/comic.php"), Arrays.asList(new HtmlFilter(), new GirlGeniusComicFilter()), new ComicMerger());
}
}
/** Creates a new watcher for Cyanide and Happiness comics. */
public KevinAndKellWatcher() {
- super(new HttpQuery("http://www.kevinandkell.com/"), Arrays.asList(new HtmlFilter(), new KevinAndKellComicFilter()), new ComicMerger());
+ super(new HttpQuery("https://kevinandkell.com/"), Arrays.asList(new HtmlFilter(), new KevinAndKellComicFilter()), new ComicMerger());
}
}
/** Creates a new “Least I Could Do” watcher. */
public LeastICouldDoWatcher() {
- super(new HttpQuery("http://www.leasticoulddo.com/"), createFilters(), new ComicMerger());
+ super(new HttpQuery("https://leasticoulddo.com/"), createFilters(), new ComicMerger());
}
//
/** Creates a new watcher for Cyanide and Happiness comics. */
public PoorlyDrawnLinesWatcher() {
- super(new HttpQuery("http://poorlydrawnlines.com/"), Arrays.asList(new HtmlFilter(), new PoorlyDrawnLinesComicFilter()), new ComicMerger());
+ super(new HttpQuery("https://poorlydrawnlines.com/"), Arrays.asList(new HtmlFilter(), new PoorlyDrawnLinesComicFilter()), new ComicMerger());
}
}
/** Creates a new watcher for Cyanide and Happiness comics. */
public SaturdayMorningBreakfastCerealWatcher() {
- super(new HttpQuery("http://www.smbc-comics.com/"), Arrays.asList(new HtmlFilter(), new SaturdayMorningBreakfastCerealComicFilter()), new ComicMerger());
+ super(new HttpQuery("https://www.smbc-comics.com/"), Arrays.asList(new HtmlFilter(), new SaturdayMorningBreakfastCerealComicFilter()), new ComicMerger());
}
}
package net.pterodactylus.rhynodge.watchers;
-import java.util.List;
-
-import net.pterodactylus.rhynodge.Filter;
-import net.pterodactylus.rhynodge.filters.ExtractUrlFilter;
import net.pterodactylus.rhynodge.filters.HtmlFilter;
-import net.pterodactylus.rhynodge.filters.HttpQueryFilter;
import net.pterodactylus.rhynodge.filters.comics.ScandinaviaAndTheWorldComicFilter;
import net.pterodactylus.rhynodge.mergers.ComicMerger;
import net.pterodactylus.rhynodge.queries.HttpQuery;
-import com.google.common.base.Optional;
-import com.google.common.collect.ImmutableList;
-import org.jsoup.nodes.Document;
-import org.jsoup.select.Elements;
+import static java.util.Arrays.asList;
/**
* {@link net.pterodactylus.rhynodge.Watcher} implementation that watches for new Scandinavia and the World comics.
public class ScandinaviaAndTheWorldWatcher extends DefaultWatcher {
public ScandinaviaAndTheWorldWatcher() {
- super(new HttpQuery("http://satwcomic.com/"), createFilters(), new ComicMerger());
- }
-
- private static List<Filter> createFilters() {
- ImmutableList.Builder<Filter> filters = ImmutableList.builder();
-
- filters.add(new HtmlFilter());
- filters.add(new ExtractUrlFilter() {
-
- @Override
- protected Optional<String> extractUrl(Document document) {
- Elements linkTag = document.select("a.btn-success");
- return linkTag.hasAttr("href") ? Optional.of(linkTag.attr("href")) : Optional.<String>absent();
- }
- });
- filters.add(new HttpQueryFilter());
- filters.add(new HtmlFilter());
- filters.add(new ScandinaviaAndTheWorldComicFilter());
-
- return filters.build();
+ super(new HttpQuery("https://satwcomic.com/latest"), asList(new HtmlFilter(), new ScandinaviaAndTheWorldComicFilter()), new ComicMerger());
}
}
public class SinfestWatcher extends DefaultWatcher {
public SinfestWatcher() {
- super(new HttpQuery("http://www.sinfest.net/"), Arrays.asList(new HtmlFilter(), new SinfestComicFilter()), new ComicMerger());
+ super(new HttpQuery("https://sinfest.xyz/"), Arrays.asList(new HtmlFilter(), new SinfestComicFilter()), new ComicMerger());
}
}
/** Creates a new XKCD watcher. */
public XkcdWatcher() {
- super(new HttpQuery("http://xkcd.com/"), Arrays.asList(new HtmlFilter(), new XkcdComicFilter()), new ComicMerger());
+ super(new HttpQuery("https://xkcd.com/"), Arrays.asList(new HtmlFilter(), new XkcdComicFilter()), new ComicMerger());
}
}
class TheMonsterUnderTheBedWatcher : DefaultWatcher(query, filters, merger)
-private val query = HttpQuery("http://themonsterunderthebed.net/")
+private val query = HttpQuery("https://themonsterunderthebed.net/")
private val filters = listOf(HtmlFilter(), TheMonsterUnderTheBedFilter())
private val merger = ComicMerger()
public ScandinaviaAndTheWorldComicFilterTest() throws IOException {
Document document = ResourceLoader.loadDocument(ScandinaviaAndTheWorldComicFilter.class, "scandinavia-and-the-world.html",
- "http://satwcomic.com/");
- htmlState = new HtmlState("http://satwcomic.com/", document);
+ "https://satwcomic.com/latest");
+ htmlState = new HtmlState("https://satwcomic.com/latest", document);
}
@Test