use of org.finos.symphony.rssbot.feed.Article in project spring-bot by finos.
the class CachingCheckingArticleSender method alreadyPosted.
@Override
protected boolean alreadyPosted(Addressable a, Article article) {
SoftReference<Set<Article>> articles = alreadySent.get(a);
if (articles != null) {
Set<Article> inner = articles.get();
if (inner != null) {
for (Article article2 : inner) {
if (article2.getUri().equals(article.getUri())) {
return true;
}
}
}
}
boolean out = super.alreadyPosted(a, article);
if (out) {
recordSent(a, article);
}
return out;
}
use of org.finos.symphony.rssbot.feed.Article in project spring-bot by finos.
the class TimedAlerter method allItemsInFeed.
private int allItemsInFeed(Feed f, Addressable a, FeedList fl) {
int count = 0;
try {
for (SyndEntry e : loader.createSyndFeed(f).getEntries()) {
if (passesFilter(e, fl)) {
HashTag fht = createFeedHashTag(f);
HashTag aht = createArticleHashTag(e.getLink());
Article article = new Article(e.getTitle(), e.getAuthor(), f.getName(), e.getLink(), fl, fht, aht);
count += sender.post(a, article);
}
}
} catch (Exception e) {
LOG.error("Coulnd't process feed" + f.getName(), e);
}
return count;
}