Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enh(79): Add categories to news items. #80

Merged
merged 1 commit into from
Aug 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.rometools.rome.feed.synd.SyndCategory;
import com.rometools.rome.feed.synd.SyndPerson;

/**
Expand All @@ -40,6 +40,7 @@ public class NewsFeedItem implements Comparable<NewsFeedItem> {
private String uri;
private FullStory fullStory;
private Date pubDate;
private List<SyndCategory> categories;

public String getImageUrl() {
return imageUrl;
Expand Down Expand Up @@ -121,6 +122,14 @@ public void setPubDate(Date pubDate) {
this.pubDate = pubDate;
}

public List<SyndCategory> getCategories() {
return categories;
}

public void setCategories(List<SyndCategory> categories) {
this.categories = categories;
}

@Override
public int compareTo(NewsFeedItem that) {
if (this.pubDate == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public PaginatingNewsFeed getFeed(InputStream in, String titlePolicy, String des
protected NewsFeedItem getNewsFeedItem(SyndEntry entry, String titlePolicy, String descriptionPolicy) throws PolicyException, ScanException {
NewsFeedItem item = new NewsFeedItem();
item.setAuthors(entry.getAuthors());
item.setCategories(entry.getCategories());
item.setLink(entry.getLink());
item.setUri(entry.getUri());

Expand Down