首先去下載個rsslibj的包:[點擊這里]
參考官方網站的例子程序
import com.rsslibj.elements.Channel;
public class Writer {
public static void main(String[] args)
throws InstantiationException, ClassNotFoundException,
IllegalaccessException {
Channel channel=new Channel();
channel.setDescr channel.setLink("http://localhost/");
channel.setTitle("My Channel");
channel.setImage("http://localhost/",
"The Channel Image",
"http://localhost/foo.jpg");
channel.setTextInput("http://localhost/search",
"Search The Channel Image",
"The Channel Image",
"s");
channel.addItem("http://localhost/item1",
"The First Item covers details on the first item>",
"The First Item")
.setDcContributor("Joseph B. Ottinger");
channel.addItem("http://localhost/item2",
"The Second Item covers details on the second item",
"The Second Item")
.setDcCreator("Jason Bell");
System.out. }
}
開始懷疑中文會有問題(老外的軟件),測試了一下居然很好,什么問題也沒有。你要是熟悉rss文檔格式,很輕易編寫一個標準的rss的writer出來。
|
新聞熱點
疑難解答