Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package romeclient;
- import com.sun.syndication.feed.synd.SyndCategoryImpl;
- import com.sun.syndication.feed.synd.SyndContentImpl;
- import com.sun.syndication.feed.synd.SyndEntry;
- import com.sun.syndication.feed.synd.SyndFeed;
- import com.sun.syndication.feed.synd.SyndLinkImpl;
- import com.sun.syndication.io.FeedException;
- import com.sun.syndication.io.SyndFeedInput;
- import com.sun.syndication.io.XmlReader;
- import java.io.IOException;
- import java.net.MalformedURLException;
- import java.net.URL;
- import java.util.List;
- import java.util.logging.Logger;
- public class A {
- private static Logger log = Logger.getLogger(A.class.getName());
- public void foo() throws MalformedURLException, IllegalArgumentException, FeedException, IOException {
- String na = "http://feed.nashownotes.com/rss.xml";
- URL url = new URL(na);
- SyndFeedInput input = new SyndFeedInput();
- SyndFeed feed = input.build(new XmlReader(url));
- log.info(feed.toString());
- for (SyndEntry entry : (List<SyndEntry>) feed.getEntries()) {
- log.info(entry.toString());
- for (SyndLinkImpl link : (List<SyndLinkImpl>) entry.getLinks()) {
- log.info(link.toString());
- }
- for (SyndContentImpl content : (List<SyndContentImpl>) entry.getContents()) {
- log.info(content.toString());
- }
- for (SyndCategoryImpl category : (List<SyndCategoryImpl>) entry.getCategories()) {
- log.info(category.toString());
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment