private String parseFeed(JDFeedMeFeed feed, String timestamp, String content) throws Exception { String new_timestamp = timestamp; boolean found_new_posts = false; // parse the rss xml RssParser feed_parser = new RssParser(feed); feed_parser.parseContent(content); int feed_item_number = 0; JDFeedMePost post = null; while ((post = feed_parser.getPost()) != null) { feed_item_number++; // get the original description String post_description = post.getDescription(); // originally we removed the description from the posts since posts are saved in xml and this // could become large // new feature: let's do save the description, but make it somewhat shorter (extract links // from it) post.setDescription( extractLinksFromHtml( post_description, JDFeedMeFeed.HOSTER_ANY_HOSTER, JDFeedMeFeed.HOSTER_EXCLUDE)); // handle the rss item if (post.isValid()) { boolean is_new = handlePost(feed, post, post_description, timestamp); if (is_new) found_new_posts = true; if (post.isTimestampNewer(new_timestamp)) new_timestamp = post.getTimestamp(); } else { logger.severe( "JDFeedMe rss item " + Integer.toString(feed_item_number) + " is invalid for feed: " + feed.getAddress()); } } // if found new posts, update the feed if (found_new_posts) gui.setFeedNewposts(feed, true); return new_timestamp; }