关于使用 Informa RSS 库的问题 [英] Question on using Informa RSS Library
问题描述
我刚刚开始研究这项技术,但我发现它很难理解,
I Just started looking at this technology , but i am finding it hard to understand,
我只想输入一个简单的 RSS 提要网址,
i want to just reed in a simple rss feed url,
并显示其内容我该怎么做?
and display its contents how could i do this?
这就是我目前所想的
URL inpFile = new URL("feed://images.apple.com/main/rss/hotnews/hotnews.rss");
ChannelIF channel = FeedParser.parse(new ChannelBuilder(), inpFile);
System.out.println(channel.getDescription());
这会产生格式错误的 url 异常,谁能帮帮我???
this creates a malformed url exeception, can anyone help me???
推荐答案
我用过 Informa,但你的问题与 Informa 无关.您的网址格式不正确.java.net.URL
需要一个标准的 URL,即具有正常"方案的 URL,如http:".因此,它会阻塞带有feed:"方案的 URL.尝试使用:
I've used Informa, but your problem has nothing to do with Informa. Your URL is malformed. java.net.URL
expects a standard URL, i.e., one with a "normal" scheme like "http:". Thus, it barfs on a URL with the scheme "feed:". Try using:
URL inpFile = new URL("http://images.apple.com/main/rss/hotnews/hotnews.rss")
ChannelIF channel = FeedParser.parse(new ChannelBuilder(), inpFile);
此外,如果您在使用 Informa 时遇到问题,请尝试使用 ROME API.不久前,我不再使用 Informa,转而使用 ROME.
Also, if you run into problems with Informa, try the ROME API. I quit using Informa, in favor of ROME, awhile ago.
这篇关于关于使用 Informa RSS 库的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!