国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

學以致用:寫一個屬于自己的Rss

2019-11-17 06:10:15
字體:
來源:轉載
供稿:網友
   今天看到系統發來的短消息,采用rss訂閱每個類別最新文檔。我查了下資料,發現有個rsslibj的開源工具可以幫助我們寫自己的rss文檔。當然,我這里講的是java的實現。

  首先去下載個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出來。




發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 沁水县| 卓资县| 都匀市| 石景山区| 依兰县| 西充县| 观塘区| 长垣县| 丰宁| 安丘市| 天柱县| 木兰县| 溧阳市| 息烽县| 平利县| 白河县| 荆门市| 松滋市| 湖口县| 湄潭县| 沁阳市| 邵阳县| 高雄市| 衡阳市| 法库县| 鹤壁市| 东乌| 肇东市| 辽宁省| 岑溪市| 饶河县| 莱芜市| 黄浦区| 南投市| 介休市| 托里县| 株洲市| 新平| 商城县| 宝坻区| 天峨县|