熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> Javascript >> 正文

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

2022-06-13   來源: Javascript 

  今天看到系統發來的短消息采用RSS訂閱每個類別最新文檔我查了下資料發現有個rsslibj的開源工具可以幫助我們寫自己的rss文檔當然我這裡講的是java的實現
  
  import comrsslibjelementsChannel;
  
  public class Writer {
  public static void main(String[] args)
  throws InstantiationException ClassNotFoundException
  IllegalAccessException {
  Channel channel=new Channel();
  channelsetDescription(This is my sample channel);
  channelsetLink(//localhost/);
  channelsetTitle(My Channel);
  channelsetImage(//localhost/
  The Channel Image
  );
  channelsetTextInput(//localhost/search
  Search The Channel Image
  The Channel Image
  s);
  channeladdItem(//localhost/item
  The First Item covers details on the first item>
  The First Item)
  setDcContributor(Joseph B Ottinger);
  channeladdItem(//localhost/item
  The Second Item covers details on the second item
  The Second Item)
  setDcCreator(Jason Bell);
  Systemoutprintln(The feed in RDF: +channelgetFeed(rdf));
  }
  }
  
  開始懷疑中文會有問題(老外的軟件)測試了一下居然很好什麼問題也沒有你要是熟悉rss文檔格式很容易編寫一個標准的rss的writer出來

From:http://tw.wingwit.com/Article/program/Java/Javascript/201311/25489.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.