RSS解析工具

ROME is a set of Atom/RSS Java utilities that make it easy to work in Java with most syndication formats:

  • RSS 0.90
  • RSS 0.91 Netscape
  • RSS 0.91 Userland
  • RSS 0.92
  • RSS 0.93
  • RSS 0.94
  • RSS 1.0
  • RSS 2.0
  • Atom 0.3
  • Atom 1.0

ROME includes a set of parsers and generators for the various flavors of syndication feeds, as well as converters to convert from one format to another. The parsers can give you back Java objects that are either specific for the format you want to work with, or a generic normalized SyndFeed class that lets you work on with the data without bothering about the incoming or outgoing feed type.

 

 

SyndFeedInput input = new SyndFeedInput();
SyndFeed feed = input.build(new XmlReader(new URL(url)));
System.out.println(feed.getTitle());

List<SyndEntry> list = this.feed.getEntries();
if (list != null && !list.isEmpty()) {
       for (SyndEntry entry : list) {
               System.out.println(entry.getTitle());
       }
}

 

你可能感兴趣的:(rss)