use of org.finos.symphony.rssbot.feed.Feed in project spring-bot by finos.
the class FeedLoader method createFeed.
public Feed createFeed(String url, String name) throws FeedException {
Exception last = null;
for (ProxyProperties proxyProperties : pp) {
try {
SyndFeedInput input = new SyndFeedInput();
input.setAllowDoctypes(true);
SyndFeed feed = input.build(new XmlReader(downloadContent(url, proxyProperties)));
Feed f = new Feed();
if (!StringUtils.hasText(name)) {
f.setName(feed.getTitle());
} else {
f.setName(name);
}
f.setDescription(feed.getDescription());
f.setUrl(url);
f.setProxy(proxyProperties);
return f;
} catch (Exception e) {
LOG.info("Couldn't get feed " + url + " with " + proxyProperties.getHost());
last = e;
}
}
throw new FeedException("Couldn't download feed with any proxy", last);
}
use of org.finos.symphony.rssbot.feed.Feed in project spring-bot by finos.
the class TimedAlerter method allItems.
public int allItems(Addressable a, FeedList fl) {
int count = 0;
for (Feed f : fl.getFeeds()) {
try {
count += allItemsInFeed(f, a, fl);
flc.setNextReportTime(fl);
} catch (Exception e) {
LOG.error("AllItems failed: ", e);
responseHandler.accept(new ErrorResponse(a, e));
}
}
return count;
}
Aggregations