小编Ily*_*kov的帖子

使用罗马图书馆获取所有 RSS 提要条目

我正在使用 Java 的罗马库来解析一些 RSS。默认情况下,它需要 25 个条目。

请告诉我,如何获得接下来的 25 个条目?

我的测试代码是:

public static SyndFeed getSyndFeedForUrl(String url) throws Exception {

    SyndFeed feed = null;
    InputStream is = null;

    try {

        URLConnection openConnection = new URL(url).openConnection();
        is = new URL(url).openConnection().getInputStream();
        if("gzip".equals(openConnection.getContentEncoding())){
            is = new GZIPInputStream(is);
        }
        InputSource source = new InputSource(is);
        SyndFeedInput input = new SyndFeedInput();
        feed = input.build(source);

    } catch (Exception e){
        e.printStackTrace();
    } finally {
        if( is != null) is.close();
    }

    return feed;
}

public static void main(String[] args) {
        SyndFeed …
Run Code Online (Sandbox Code Playgroud)

java rss rome

2
推荐指数
1
解决办法
3034
查看次数

标签 统计

java ×1

rome ×1

rss ×1