protected WireFeed createRealFeed(String type, SyndFeed syndFeed) {
   Channel channel = (Channel) super.createRealFeed(type, syndFeed);
   channel.setLanguage(syndFeed.getLanguage()); // c
   channel.setCopyright(syndFeed.getCopyright()); // c
   channel.setPubDate(syndFeed.getPublishedDate()); // c
   if (syndFeed.getAuthors() != null && syndFeed.getAuthors().size() > 0) {
     SyndPerson author = (SyndPerson) syndFeed.getAuthors().get(0);
     channel.setManagingEditor(author.getName());
   }
   return channel;
 }
Beispiel #2
0
  @SuppressWarnings("unchecked")
  public void test() throws Exception {
    final SyndFeedInput input = new SyndFeedInput(true);
    final SyndFeed feed = input.build(new File("c:\\temp\\google.xml"));

    logger.debug("Successfully parsed the RSS feed");
    logger.debug("Author      = " + feed.getAuthors());
    logger.debug("Categories  = " + feed.getCategories());
    final List<SyndEntry> entries = feed.getEntries();
    for (final SyndEntry entry : entries) {
      logger.debug("Title = " + StringEscapeUtils.unescapeHtml(entry.getTitle()));
      logger.debug(
          "Description = " + StringEscapeUtils.unescapeHtml(entry.getDescription().getValue()));
      logger.debug(entry.getUri());
      logger.debug("Updated date = " + entry.getUpdatedDate());
      logger.debug("Published date = " + entry.getPublishedDate());
      logger.debug("====================================================");
    }
  }