From: David ‘Bombe’ Roden Date: Sun, 20 Sep 2020 16:39:01 +0000 (+0200) Subject: 🎨 Replace BC watcher with Kotlin version X-Git-Tag: v2~78 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=edf0639a237a4bceedaaa71290b933cdb8488a39;p=rhynodge.git 🎨 Replace BC watcher with Kotlin version --- diff --git a/src/main/java/net/pterodactylus/rhynodge/watchers/BusinessCatWatcher.java b/src/main/java/net/pterodactylus/rhynodge/watchers/BusinessCatWatcher.java deleted file mode 100644 index 5d21b36..0000000 --- a/src/main/java/net/pterodactylus/rhynodge/watchers/BusinessCatWatcher.java +++ /dev/null @@ -1,22 +0,0 @@ -package net.pterodactylus.rhynodge.watchers; - -import java.util.Arrays; - -import net.pterodactylus.rhynodge.Watcher; -import net.pterodactylus.rhynodge.filters.HtmlFilter; -import net.pterodactylus.rhynodge.filters.comics.BusinessCatComicFilter; -import net.pterodactylus.rhynodge.queries.HttpQuery; -import net.pterodactylus.rhynodge.triggers.NewComicTrigger; - -/** - * {@link Watcher} implementation that watches for new Business Cat comics. - * - * @author David ‘Bombe’ Roden - */ -public class BusinessCatWatcher extends DefaultWatcher { - - public BusinessCatWatcher() { - super(new HttpQuery("https://www.businesscatcomic.com/"), Arrays.asList(new HtmlFilter(), new BusinessCatComicFilter()), new NewComicTrigger()); - } - -} diff --git a/src/main/kotlin/net/pterodactylus/rhynodge/watchers/BusinessCatWatcher.kt b/src/main/kotlin/net/pterodactylus/rhynodge/watchers/BusinessCatWatcher.kt new file mode 100644 index 0000000..94fe96d --- /dev/null +++ b/src/main/kotlin/net/pterodactylus/rhynodge/watchers/BusinessCatWatcher.kt @@ -0,0 +1,12 @@ +package net.pterodactylus.rhynodge.watchers + +import net.pterodactylus.rhynodge.filters.HtmlFilter +import net.pterodactylus.rhynodge.filters.comics.BusinessCatComicFilter +import net.pterodactylus.rhynodge.queries.HttpQuery +import net.pterodactylus.rhynodge.triggers.NewComicTrigger + +class BusinessCatWatcher : DefaultWatcher(query, filters, trigger) + +private val query = HttpQuery("https://www.businesscatcomic.com/") +private val filters = listOf(HtmlFilter(), BusinessCatComicFilter()) +private val trigger = NewComicTrigger()