Rome is a Java framework for RSS and Atom feeds. The framework consist of several modules:
Module | Description |
---|---|
rome |
Library for generating and parsing RSS and Atom feeds. |
rome-modules |
Generators and parsers for extensions like MediaRSS, GeoRSS and others. |
rome-opml |
OPML parsers and tools. |
rome-utils |
Internal utility classes. |
Starting with Rome 2.0.0, Java 11 or higher is required.
<dependencies>
<dependency>
<groupId>com.rometools</groupId>
<artifactId>rome</artifactId>
<version>${rome.version}</version>
</dependency>
</dependencies>
String url = "https://stackoverflow.com/feeds/tag?tagnames=rome";
SyndFeed feed = new SyndFeedInput().build(new XmlReader(new URL(url)));
System.out.println(feed.getTitle());
Beware! The URL
variant used in this example is deprecated and works only for simplest cases. Please consider using a separate library for fetching the
feed (see examples in #276).
SyndFeed feed = new SyndFeedImpl();
feed.setFeedType("rss_2.0");
feed.setTitle("test-title");
feed.setDescription("test-description");
feed.setLink("https://example.org");
System.out.println(new SyndFeedOutput().outputString(feed));