This commit is contained in:
Erik C. Thauvin 2020-03-31 22:36:18 -07:00
parent df38680226
commit e3cbc4e808
2 changed files with 3 additions and 2 deletions

View file

@ -83,11 +83,11 @@ class FeedReader implements Runnable {
final SyndFeedInput input = new SyndFeedInput(); final SyndFeedInput input = new SyndFeedInput();
final SyndFeed feed = input.build(new XmlReader(new URL(url))); final SyndFeed feed = input.build(new XmlReader(new URL(url)));
SyndEntry item;
final List<SyndEntry> items = feed.getEntries(); final List<SyndEntry> items = feed.getEntries();
if (items.isEmpty()) { if (items.isEmpty()) {
bot.send(sender, "There is currently nothing to view. Why don't you post something?", false); bot.send(sender, "There is currently nothing to view. Why don't you post something?", false);
} else { } else {
SyndEntry item;
for (int i = 0; (i < items.size()) && (i < MAX_ITEMS); i++) { for (int i = 0; (i < items.size()) && (i < MAX_ITEMS); i++) {
item = items.get(i); item = items.get(i);
bot.send(sender, item.getTitle(), false); bot.send(sender, item.getTitle(), false);

View file

@ -34,6 +34,7 @@ package net.thauvin.erik.mobibot.commands
import net.thauvin.erik.mobibot.Mobibot import net.thauvin.erik.mobibot.Mobibot
import net.thauvin.erik.mobibot.Utils import net.thauvin.erik.mobibot.Utils
import net.thauvin.erik.mobibot.commands.links.UrlMgr
import java.util.* import java.util.*
class Ignore(defaultIgnore: String) : AbstractCommand() { class Ignore(defaultIgnore: String) : AbstractCommand() {
@ -41,7 +42,7 @@ class Ignore(defaultIgnore: String) : AbstractCommand() {
init { init {
if (defaultIgnore.isNotBlank()) { if (defaultIgnore.isNotBlank()) {
ignored.addAll(defaultIgnore.split(", *| +".toRegex())) ignored.addAll(defaultIgnore.split(UrlMgr.LINK_MATCH.toRegex()))
} }
} }