Search code examples
javaurlrome

Using feed:// in rome


So I am using rome and accessing a feed with the following url

URL url = new URL("feed://rss.cnn.com/rss/cnn_topstories.rss");
reader = new XmlReader(url);

(unrelated code edited out)

however, I get the following exception:

Exception in thread "main" java.net.MalformedURLException: unknown protocol: feed
at java.net.URL.<init>(URL.java:574)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at Browser.getFeed(Browser.java:84)
at Browser.doBrowser(Browser.java:49)
at Browser.main(Browser.java:38)

How do I parse this feed?


Solution

  • Replace "feed://" with "http://" and you'll be fine.