return entryToStory(entry);
}
private Story entryToStory(SyndEntry entry) {
Story story=new Story();
story.addFields(storyFields);
story.setLink(entry.getLink());
story.setRedirectEnabled(isRedirectEnabled());
Calendar date = Calendar.getInstance();
if (entry.getPublishedDate()!=null) {
date.setTime(entry.getPublishedDate());
}
else if (entry.getUpdatedDate()!=null) {
date.setTime(entry.getUpdatedDate());
}
story.setDate(date);
String title=entry.getTitle();
story.setTitle(title.trim());
String content=getFeedContent(entry);
String abstractContent=cleanHTML(content);
if(abstractContent.length() >= Constants.STORY_ABSTRACT_MAXLENGTH) {
abstractContent = abstractContent.substring(0, Constants.STORY_ABSTRACT_MAXLENGTH - 1) + "[...]";
}
story.setAbstractContent(abstractContent.trim());
// story.setFullContent(content.trim()); // Currently we won't have full content due to possible legal implications.
return story;
}