国产探花免费观看_亚洲丰满少妇自慰呻吟_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出來。




發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 梁平县| 栖霞市| 平舆县| 清流县| 木里| 沈丘县| 杂多县| 闻喜县| 丁青县| 宝兴县| 玛沁县| 巨野县| 洪江市| 西乌| 聂荣县| 遵化市| 固阳县| 高台县| 灵川县| 丹东市| 永善县| 文水县| 乾安县| 盖州市| 乐安县| 曲靖市| 房产| 电白县| 宜章县| 秦皇岛市| 定陶县| 杨浦区| 南康市| 淮安市| 澄迈县| 墨玉县| 敦化市| 天等县| 通许县| 运城市| 基隆市|