5 import com.rometools.rome.feed.synd.SyndEntry;
6 import com.rometools.rome.feed.synd.SyndFeed;
9 private static void appendA(StringBuffer buf, String child, String href) {
10 buf.append("<a href='");
17 private static void appendDiv(StringBuffer buf, String child) {
20 buf.append("</div>\n");
23 private static void append(StringBuffer buf, SyndEntry entry) {
25 appendA(buf, entry.getTitle(), entry.getLink());
26 buf.append("</div>\n");
28 appendDiv(buf, entry.getPublishedDate().toString());
29 appendDiv(buf, entry.getDescription().getValue());
32 public static void append(StringBuffer buf, SyndFeed feed) {
33 for (SyndEntry e: feed.getEntries()) {
38 public static String toHTML(List<SyndFeed> feeds) {
41 buf = new StringBuffer();
42 buf.append("<!DOCTYPE html>\n");
43 buf.append("<html>\n");
44 buf.append("<head>\n");
45 buf.append("<meta charset=\"UTF-8\">\n");
46 buf.append("</head>\n");
47 buf.append("<body>\n");
49 for (SyndFeed e: feeds)
52 buf.append("</body>\n");
53 buf.append("</html>\n");
55 return buf.toString();