From 889e90982cf5921836868b42f1191502ef270d24 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 27 Oct 2021 21:44:12 +0200 Subject: [PATCH] =?utf8?q?=F0=9F=94=92=EF=B8=8F=20Update=20a=20bunch=20of?= =?utf8?q?=20URLs=20to=20https?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../rhynodge/watchers/AbstruseGooseWatcher.java | 2 +- .../rhynodge/watchers/CtrlAltDelWatcher.java | 2 +- .../watchers/CyanideAndHappinessWatcher.java | 2 +- .../watchers/GeneralProtectionFaultWatcher.java | 2 +- .../rhynodge/watchers/GirlGeniusWatcher.java | 2 +- .../rhynodge/watchers/KevinAndKellWatcher.java | 2 +- .../rhynodge/watchers/LeastICouldDoWatcher.java | 2 +- .../rhynodge/watchers/PoorlyDrawnLinesWatcher.java | 2 +- .../SaturdayMorningBreakfastCerealWatcher.java | 2 +- .../watchers/ScandinaviaAndTheWorldWatcher.java | 31 ++-------------------- .../rhynodge/watchers/SinfestWatcher.java | 2 +- .../rhynodge/watchers/XkcdWatcher.java | 2 +- .../watchers/TheMonsterUnderTheBedWatcher.kt | 2 +- .../ScandinaviaAndTheWorldComicFilterTest.java | 4 +-- 14 files changed, 16 insertions(+), 43 deletions(-) diff --git a/src/main/java/net/pterodactylus/rhynodge/watchers/AbstruseGooseWatcher.java b/src/main/java/net/pterodactylus/rhynodge/watchers/AbstruseGooseWatcher.java index 0fd1105..f287599 100644 --- a/src/main/java/net/pterodactylus/rhynodge/watchers/AbstruseGooseWatcher.java +++ b/src/main/java/net/pterodactylus/rhynodge/watchers/AbstruseGooseWatcher.java @@ -33,7 +33,7 @@ import net.pterodactylus.rhynodge.queries.HttpQuery; 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()); } } diff --git a/src/main/java/net/pterodactylus/rhynodge/watchers/CtrlAltDelWatcher.java b/src/main/java/net/pterodactylus/rhynodge/watchers/CtrlAltDelWatcher.java index ad93e1f..4eabb44 100644 --- a/src/main/java/net/pterodactylus/rhynodge/watchers/CtrlAltDelWatcher.java +++ b/src/main/java/net/pterodactylus/rhynodge/watchers/CtrlAltDelWatcher.java @@ -34,7 +34,7 @@ public class CtrlAltDelWatcher extends DefaultWatcher { /** 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()); } } diff --git a/src/main/java/net/pterodactylus/rhynodge/watchers/CyanideAndHappinessWatcher.java b/src/main/java/net/pterodactylus/rhynodge/watchers/CyanideAndHappinessWatcher.java index 331ec4b..377c5bc 100644 --- a/src/main/java/net/pterodactylus/rhynodge/watchers/CyanideAndHappinessWatcher.java +++ b/src/main/java/net/pterodactylus/rhynodge/watchers/CyanideAndHappinessWatcher.java @@ -35,7 +35,7 @@ public class CyanideAndHappinessWatcher extends DefaultWatcher { /** 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()); } } diff --git a/src/main/java/net/pterodactylus/rhynodge/watchers/GeneralProtectionFaultWatcher.java b/src/main/java/net/pterodactylus/rhynodge/watchers/GeneralProtectionFaultWatcher.java index f57762c..fae911a 100644 --- a/src/main/java/net/pterodactylus/rhynodge/watchers/GeneralProtectionFaultWatcher.java +++ b/src/main/java/net/pterodactylus/rhynodge/watchers/GeneralProtectionFaultWatcher.java @@ -35,7 +35,7 @@ public class GeneralProtectionFaultWatcher extends DefaultWatcher { /** 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()); } } diff --git a/src/main/java/net/pterodactylus/rhynodge/watchers/GirlGeniusWatcher.java b/src/main/java/net/pterodactylus/rhynodge/watchers/GirlGeniusWatcher.java index e1aa4a2..68e5e03 100644 --- a/src/main/java/net/pterodactylus/rhynodge/watchers/GirlGeniusWatcher.java +++ b/src/main/java/net/pterodactylus/rhynodge/watchers/GirlGeniusWatcher.java @@ -34,7 +34,7 @@ public class GirlGeniusWatcher extends DefaultWatcher { /** 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()); } } diff --git a/src/main/java/net/pterodactylus/rhynodge/watchers/KevinAndKellWatcher.java b/src/main/java/net/pterodactylus/rhynodge/watchers/KevinAndKellWatcher.java index 6826e25..749b95c 100644 --- a/src/main/java/net/pterodactylus/rhynodge/watchers/KevinAndKellWatcher.java +++ b/src/main/java/net/pterodactylus/rhynodge/watchers/KevinAndKellWatcher.java @@ -34,7 +34,7 @@ public class KevinAndKellWatcher extends DefaultWatcher { /** 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()); } } diff --git a/src/main/java/net/pterodactylus/rhynodge/watchers/LeastICouldDoWatcher.java b/src/main/java/net/pterodactylus/rhynodge/watchers/LeastICouldDoWatcher.java index 13d48c9..a620145 100644 --- a/src/main/java/net/pterodactylus/rhynodge/watchers/LeastICouldDoWatcher.java +++ b/src/main/java/net/pterodactylus/rhynodge/watchers/LeastICouldDoWatcher.java @@ -43,7 +43,7 @@ public class LeastICouldDoWatcher extends DefaultWatcher { /** 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()); } // diff --git a/src/main/java/net/pterodactylus/rhynodge/watchers/PoorlyDrawnLinesWatcher.java b/src/main/java/net/pterodactylus/rhynodge/watchers/PoorlyDrawnLinesWatcher.java index 0ea2849..533968a 100644 --- a/src/main/java/net/pterodactylus/rhynodge/watchers/PoorlyDrawnLinesWatcher.java +++ b/src/main/java/net/pterodactylus/rhynodge/watchers/PoorlyDrawnLinesWatcher.java @@ -35,7 +35,7 @@ public class PoorlyDrawnLinesWatcher extends DefaultWatcher { /** 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()); } } diff --git a/src/main/java/net/pterodactylus/rhynodge/watchers/SaturdayMorningBreakfastCerealWatcher.java b/src/main/java/net/pterodactylus/rhynodge/watchers/SaturdayMorningBreakfastCerealWatcher.java index 3e90a00..d909f07 100644 --- a/src/main/java/net/pterodactylus/rhynodge/watchers/SaturdayMorningBreakfastCerealWatcher.java +++ b/src/main/java/net/pterodactylus/rhynodge/watchers/SaturdayMorningBreakfastCerealWatcher.java @@ -35,7 +35,7 @@ public class SaturdayMorningBreakfastCerealWatcher extends DefaultWatcher { /** 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()); } } diff --git a/src/main/java/net/pterodactylus/rhynodge/watchers/ScandinaviaAndTheWorldWatcher.java b/src/main/java/net/pterodactylus/rhynodge/watchers/ScandinaviaAndTheWorldWatcher.java index cb7775f..592a488 100644 --- a/src/main/java/net/pterodactylus/rhynodge/watchers/ScandinaviaAndTheWorldWatcher.java +++ b/src/main/java/net/pterodactylus/rhynodge/watchers/ScandinaviaAndTheWorldWatcher.java @@ -17,20 +17,12 @@ 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. @@ -40,26 +32,7 @@ import org.jsoup.select.Elements; public class ScandinaviaAndTheWorldWatcher extends DefaultWatcher { public ScandinaviaAndTheWorldWatcher() { - super(new HttpQuery("http://satwcomic.com/"), createFilters(), new ComicMerger()); - } - - private static List createFilters() { - ImmutableList.Builder filters = ImmutableList.builder(); - - filters.add(new HtmlFilter()); - filters.add(new ExtractUrlFilter() { - - @Override - protected Optional extractUrl(Document document) { - Elements linkTag = document.select("a.btn-success"); - return linkTag.hasAttr("href") ? Optional.of(linkTag.attr("href")) : Optional.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()); } } diff --git a/src/main/java/net/pterodactylus/rhynodge/watchers/SinfestWatcher.java b/src/main/java/net/pterodactylus/rhynodge/watchers/SinfestWatcher.java index 914f614..39911fd 100644 --- a/src/main/java/net/pterodactylus/rhynodge/watchers/SinfestWatcher.java +++ b/src/main/java/net/pterodactylus/rhynodge/watchers/SinfestWatcher.java @@ -33,7 +33,7 @@ import net.pterodactylus.rhynodge.queries.HttpQuery; 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()); } } diff --git a/src/main/java/net/pterodactylus/rhynodge/watchers/XkcdWatcher.java b/src/main/java/net/pterodactylus/rhynodge/watchers/XkcdWatcher.java index 9829d82..a363281 100644 --- a/src/main/java/net/pterodactylus/rhynodge/watchers/XkcdWatcher.java +++ b/src/main/java/net/pterodactylus/rhynodge/watchers/XkcdWatcher.java @@ -34,7 +34,7 @@ public class XkcdWatcher extends DefaultWatcher { /** 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()); } } diff --git a/src/main/kotlin/net/pterodactylus/rhynodge/watchers/TheMonsterUnderTheBedWatcher.kt b/src/main/kotlin/net/pterodactylus/rhynodge/watchers/TheMonsterUnderTheBedWatcher.kt index a596d12..116d520 100644 --- a/src/main/kotlin/net/pterodactylus/rhynodge/watchers/TheMonsterUnderTheBedWatcher.kt +++ b/src/main/kotlin/net/pterodactylus/rhynodge/watchers/TheMonsterUnderTheBedWatcher.kt @@ -7,6 +7,6 @@ import net.pterodactylus.rhynodge.queries.* 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() diff --git a/src/test/java/net/pterodactylus/rhynodge/filters/comics/ScandinaviaAndTheWorldComicFilterTest.java b/src/test/java/net/pterodactylus/rhynodge/filters/comics/ScandinaviaAndTheWorldComicFilterTest.java index be54a38..53461cb 100644 --- a/src/test/java/net/pterodactylus/rhynodge/filters/comics/ScandinaviaAndTheWorldComicFilterTest.java +++ b/src/test/java/net/pterodactylus/rhynodge/filters/comics/ScandinaviaAndTheWorldComicFilterTest.java @@ -31,8 +31,8 @@ public class ScandinaviaAndTheWorldComicFilterTest { 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 -- 2.7.4