http://dev.firnow.com/course/3_program/java/javajs/20090412/164801.html
package com.stefli.rss;
import java.util.ArrayList;
import java.util.List;
import com.sun.syndication.feed.rss.Channel;
import com.sun.syndication.feed.rss.Description;
import com.sun.syndication.feed.rss.Item;
import com.sun.syndication.io.FeedException;
import com.sun.syndication.io.WireFeedOutput;
public class RssGeneratorByRome {
public static void main(String[] args) {
/*
* Channel(String type), search the type from
* rome.properties in the rome.jar
*/
Channel channel = new Channel("rss_2.0");
channel.setTitle("The test of RSS generator(Rome)");
channel.setDescription("Description");
channel.setLink("http://www.stefli.com/");
channel.setTtl(5);
channel.setLanguage("en_US");
channel.setEncoding("utf-8");
List items = new ArrayList();
Item item = new Item();
item.setAuthor("<a title="" href="http://www2.gliet.edu.cn/gdhq/kudesign/" target="_blank">stefli</a>");
item.setTitle("Here is a news!");
item.setLink("http://www.stefli.com/");
Description description = new Description();
description.setType("html");
description.setValue("The news is that you are <b>win</b> the game!!");
item.setDescription(description);
items.add(item);
channel.setItems(items);
WireFeedOutput out = new WireFeedOutput();
try {
System.out.println(out.outputString(channel));
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (FeedException e) {
e.printStackTrace();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>The test of RSS generator(Rome)</title>
<link>http://www.stefli.com/</link>
<description>Description</description>
<language>en_US</language>
<ttl>5</ttl>
<item>
<title>Here is a news!</title>
<link>http://www.stefli.com/</link>
<description>The news is that you are <b>win</b> the game!!</description>
<author>stefli</author>
</item>
</channel>
</rss>
分享到:
相关推荐
rome-1.0RC2 source,jar and doc
java使用Rome解析Rss的实例
Rome 项目介绍及其在 RSS 解析中的应用 Rome 是一个基于 Java 的开源项目,提供了一组 Atom/RSS 工具类,以使得用 Java 可以更方便和快捷地操作大部分 Syndication 格式数据。Rome 需要 JDK1.4 以上版本和 JDom.jar...
RSS的一个工具类基于JAVA,可以解析URL生成XML也可以通过传参生成一个RSS,注释详细,用到ROME和JDOM技术,欢迎大家借鉴学习.
在做的过程中遇到中文字符出错的问题,网上也有很多人提出来,但是好能解决的不多,如果你也遇到这个问题,请详细看本文档!
RSS开源框架ROME1.0下载集合 1.rome-1.0-javadoc 2.rome-1.0-sources
Rome是一个用于RSS和Atom提要的Java框架。框架由几个模块组成:
NULL 博文链接:https://chenhao-yssy.iteye.com/blog/1074264
Rome解析RSS必备jar
Rome是为RSS聚合而开发的一个框架,让你可以快速的开发基于java的RSS阅读,发布器,支持 RSS 0.91 Netscape RSS 0.91 Userland RSS 0.92 RSS 0.93 RSS 0.94 RSS 1.0 RSS 2.0 Atom 0.3 Atom 1.0 等标准。
罗马是用于RSS和Atom提要的Java框架。 该框架包含几个模块: :warning: 由于缺乏积极的维护者,该项目的维护和开发目前受到限制。 考虑成为一个积极的维护者。 项目结构 模块 描述 rome 用于生成和解析RSS和Atom...
Rome是为RSS聚合而开发的一个框架,让你可以快速的开发基于java的RSS阅读
rome开发rss jdom rom1.0
rome包rss使用 支持各种rss版本 XXXXX XXXXX XXXXX XXXX
rss读写功能,直接用eclipse导入即可,有需要的请猛击下载
rome-1.0.jar jdom.jar 并提供第一个RSS发布实例 (可以使用IO流写到本地xml文件;包括所需jar包,及一个成功的实例)
rome开发获取rss 配合jdom简单方便。十分的好用,欢迎下载。
java相关RSS 部分资料已经生成代码和jar包
java 开发rss订阅 所需的 rsslibj-1_0RC2.jar EXML.jar rome-1.0.jar包
rome-1.0.jar rome.jar 源码