if (response.getStatus() != Status.OK.getStatusCode()) {
return response;
}
Entries entries = (Entries) response.getEntity();
SyndFeed feed = new SyndFeedImpl();
feed.setFeedType("rss_2.0");
feed.setTitle("CommaFeed - " + entries.getName());
feed.setDescription("CommaFeed - " + entries.getName());
String publicUrl = config.getApplicationSettings().getPublicUrl();
feed.setLink(publicUrl);
List<SyndEntry> children = Lists.newArrayList();
for (Entry entry : entries.getEntries()) {
children.add(entry.asRss());
}
feed.setEntries(children);
SyndFeedOutput output = new SyndFeedOutput();
StringWriter writer = new StringWriter();
try {
output.output(feed, writer);